Ha a függvényt bemásolom a cuccba akk is hibátlan a compiler
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
de 0kb-s amx-et csin ( filterscript ) ha meg kiveszem akk is hibátlan és akk megcsinja az amx-et is normra.. ez mért van??
A Függvény a következõ :
fuggveny PenzLevesz(playerid, penz)
{
new penze = VanEnnyiPenze(playerid, penz);
if(penze == 0) return false;
else if(penze == 1) GiveMoney(playerid, -penz);
else if(penze == 2) PlayerInfo[playerid][pAccount] -= penz;
return true;
}
fuggveny VanEnnyiPenze(playerid, penz)
{
if(GetMoney(playerid) >= penz)
return 1;
else if(PlayerInfo[playerid][pAccount] >= penz)
return 2;
return 0;
}
Oka : SeeRPG-s szerómba akarom berakni a cuccot, de a pénzt dollárba akarja leveni ( vmi v. vagy kell még oda vagy nemtom :( )
A Script ( Giveplayermoneyrõl én irtma givemony re stb )
#include <a_samp>
new Text3D:entrancetext;
new entrancegate, exitgate;
new water1, water2, water3, water4, water5, water6, water7;
new usingcarwash = -1;
new unwashable[89][0] = {
{403},{406},{408},{414},{417},
{423},{424},{425},{430},{431},
{432},{433},{435},{437},{441},
{443},{444},{446},{447},{448},
{452},{453},{454},{455},{456},
{457},{460},{461},{462},{463},
{464},{465},{468},{469},{471},
{472},{473},{476},{481},{484},
{485},{486},{487},{488},{493},
{497},{498},{501},{508},{509},
{510},{511},{512},{513},{514},
{515},{519},{520},{521},{522},
{523},{524},{530},{531},{532},
{539},{544},{548},{553},{556},
{557},{563},{564},{568},{571},
{572},{573},{574},{577},{578},
{581},{583},{586},{588},{592},
{593},{594},{595},{609}
};
forward Autocruise(playerid, in);
forward OpenExit(playerid);
forward EndWash(playerid);
forward Water(playerid, on);
public OnFilterScriptInit()
{
print(\"\\n-----------------------------------------------\");
print(\" \");
print(\"---=== Auto Mosó Filterscript ===---\");
print(\" \");
print(\"-------------- Copyright -- 2013 --------------\\n\");
entrancegate = CreateObject(17951,1911.21130371,-1780.68151855,14.15972233,0.00000000,0.00000000,90.00000000);
exitgate = CreateObject(17951,1911.21130371,-1771.97814941,14.15972233,0.00000000,0.00000000,90.00000000);
CreateObject(1250,1908.84997559,-1783.68945312,13.40625000,0.00000000,0.00000000,90.00000000);
CreatePickup(1239, 1, 1911.1886,-1784.2952,13.5, -1);
entrancetext = Create3DTextLabel(\"Senkisem használja a autómosót most.\\nÁr: $5 Parancs: (/carwash)\",0x008B00FF,1911.1886,-1784.2952,14.5,50,0,1);
return 1;
}
public OnFilterScriptExit()
{
DestroyObject(entrancegate);
DestroyObject(exitgate);
DestroyObject(3);
DestroyPickup(1);
Delete3DTextLabel(entrancetext);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPlayerVehicleID(i) == GetPlayerVehicleID(usingcarwash))
{
DestroyPlayerObject(i, water1);
DestroyPlayerObject(i, water2);
DestroyPlayerObject(i, water3);
DestroyPlayerObject(i, water4);
DestroyPlayerObject(i, water5);
DestroyPlayerObject(i, water6);
DestroyPlayerObject(i, water7);
TogglePlayerControllable(i, 1);
SetCameraBehindPlayer(i);
}
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
if(usingcarwash == playerid)
{
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
usingcarwash = -1;
Update3DTextLabelText(entrancetext, 0x008B00FF, \"Senkisem használja a autómosót.\\nÁra: $5 Parancs: (/carwash)\");
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(usingcarwash == playerid)
{
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
usingcarwash = -1;
Update3DTextLabelText(entrancetext, 0x008B00FF, \"Senkisem használja a autómosót.\\nÁr: $5 Parancs:(/carwash)\");
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(\"/carwash\", cmdtext, true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 5, 1911.1886,-1784.2952,13.0801))
{
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
for(new x = 0; x < sizeof(unwashable); x++)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == unwashable
{
SendClientMessage(playerid, 0xAA3333AA, \"Nem lehet ezt a jármûvet lemosni.\");
return 1;
}
}
if(GetMoney(playerid) > 4)
{
if(usingcarwash == -1)
{
GiveMoney(playerid, -5);
usingcarwash = playerid;
Update3DTextLabelText(entrancetext, 0xB0171FFF, \"Valaki használja autómosót.\");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
{
TogglePlayerControllable(i, 0);
SetPlayerCameraPos(i,1907.8804,-1790.0590,15);
SetPlayerCameraLookAt(i,1911.0471,-1781.6868,13.3828);
}
if(GetPlayerSurfingVehicleID(i) == GetPlayerVehicleID(playerid))
{
SetPlayerPos(i,1906.9204,-1786.0435,13.5469);
SetPlayerFacingAngle(i, 270);
}
}
SetVehiclePos(GetPlayerVehicleID(playerid), 1911.1886, -1784.2952, 13.0801);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0);
MoveObject(entrancegate, 1911.21130371, -1780.68151855, 10.50000000, 1);
SetTimerEx(\"Autocruise\",3500,0,\"ii\",playerid, 1);
}
else
{
SendClientMessage(playerid, 0xAA3333AA, \"Valaki használja autómosót.\");
}
}
else
{
SendClientMessage(playerid, 0xAA3333AA, \"Nincs elég pénzed!\");
}
}
else
{
SendClientMessage(playerid, 0xAA3333AA, \"Nem te vezeted a kocsit ezért nem tudod lemosni!\");
}
}
else
{
SendClientMessage(playerid, 0xAA3333AA, \"Nem vagy autóban!\");
}
}
else
{
SendClientMessage(playerid, 0xAA3333AA, \"Nem vagy a autómosó bejáratánl.\");
}
return 1;
}
return 0;
}
public Autocruise(playerid, in)
{
new Float:vehx, Float:vehy, Float:vehz;
GetVehiclePos(GetPlayerVehicleID(playerid), vehx, vehy, vehz);
if(in == 1)
{
if(-1777 < vehy)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
{
SetPlayerCameraPos(i,1910.4637,-1771.8,15);
SetPlayerCameraLookAt(i,1911.2863,-1775.1614,13.3828);
}
}
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0);
TogglePlayerControllable(playerid, 0);
MoveObject(entrancegate, 1911.21130371, -1780.68151855, 14.15972233, 1);
SetTimerEx(\"Water\",4000,0,\"ii\",playerid, 1);
}
else
{
if(vehx != 1911.1886)
{
SetVehiclePos(GetPlayerVehicleID(playerid), 1911.1886, vehy, vehz);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0);
}
TogglePlayerControllable(playerid, 1);
SetVehicleVelocity(GetPlayerVehicleID(playerid), 0, 0.1, 0);
SetTimerEx(\"Autocruise\",100,0,\"ii\",playerid, 1);
}
}
else
{
if(-1768 < vehy)
{
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0);
TogglePlayerControllable(playerid, 0);
MoveObject(exitgate, 1911.21130371,-1771.97814941,14.15972233, 1);
SetTimerEx(\"EndWash\",1000,0,\"i\",playerid);
}
else
{
if(vehx != 1911.1886)
{
SetVehiclePos(GetPlayerVehicleID(playerid), 1911.1886, vehy, vehz);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0);
}
TogglePlayerControllable(playerid, 1);
SetVehicleVelocity(GetPlayerVehicleID(playerid), 0, 0.1, 0);
SetTimerEx(\"Autocruise\",100,0,\"ii\",playerid, 0);
}
}
return 1;
}
public Water(playerid, on)
{
if(on == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
{
DestroyPlayerObject(i, water1);
DestroyPlayerObject(i, water2);
DestroyPlayerObject(i, water3);
DestroyPlayerObject(i, water4);
DestroyPlayerObject(i, water5);
DestroyPlayerObject(i, water6);
DestroyPlayerObject(i, water7);
SetTimerEx(\"OpenExit\",500,0,\"i\",playerid);
}
}
}
else
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
{
water1 = CreatePlayerObject(i, 18747, 1911, -1776, 10, 0, 0, 90);
water2 = CreatePlayerObject(i, 18747, 1914, -1776, 10, 0, 0, 90);
water3 = CreatePlayerObject(i, 18739, 1910.1821, -1777.8997, 25, 0, 180, 0);
water4 = CreatePlayerObject(i, 18739, 1910.1821, -1774.8132, 25, 0, 180, 0);
water5 = CreatePlayerObject(i, 18739, 1912.1490, -1774.8132, 25, 0, 180, 0);
water6 = CreatePlayerObject(i, 18739, 1912.1490, -1777.8997, 25, 0, 180, 0);
water7 = CreatePlayerObject(i, 18739, 1911.2194, -1776.5117, 25, 0, 180, 0);
SetTimerEx(\"Water\",15000,0,\"ii\",playerid, 0);
}
}
}
return 1;
}
public OpenExit(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
{
SetPlayerCameraPos(i,1909.0697,-1760.7429,15);
SetPlayerCameraLookAt(i,1911.2600,-1771.5955,13.3828);
}
}
MoveObject(exitgate, 1911.21130371, -1771.97814941, 10.50000000, 1);
SetTimerEx(\"Autocruise\",3500,0,\"ii\",playerid, 0);
return 1;
}
public EndWash(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
{
TogglePlayerControllable(i, 1);
SetCameraBehindPlayer(i);
}
}
usingcarwash = -1;
Update3DTextLabelText(entrancetext, 0x008B00FF, \"Senkisem használja a autómosót most.\\nÁr: $5 Parancs: (/carwash)\");
return 1;
}
fuggveny PenzLevesz(playerid, penz)
{
new penze = VanEnnyiPenze(playerid, penz);
if(penze == 0) return false;
else if(penze == 1) GiveMoney(playerid, -penz);
else if(penze == 2) PlayerInfo[playerid][pAccount] -= penz;
return true;
}
fuggveny VanEnnyiPenze(playerid, penz)
{
if(GetMoney(playerid) >= penz)
return 1;
else if(PlayerInfo[playerid][pAccount] >= penz)
return 2;
return 0;
}
Vki megtudná csinni nekem normálisra, légyszives? mert átírtam stockra, és errorol ://
Amugy igen FS be akarom
C:\\Documents and Settings\\Rendszergazda\\Asztal\\DarenRPG\\filterscripts\\automoso.pwn(112) : error 017: undefined symbol \"GetMoney\"
C:\\Documents and Settings\\Rendszergazda\\Asztal\\DarenRPG\\filterscripts\\automoso.pwn(116) : error 017: undefined symbol \"GiveMoney\"
De seemodba ilyen definíciót én nem találtam :O
Szal a komplett script ( pls vki helpeljen :) )
#include <a_samp>
new Text3D:entrancetext;
new entrancegate, exitgate;
new water1, water2, water3, water4, water5, water6, water7;
new usingcarwash = -1;
new unwashable[89][0] = {
{403},{406},{408},{414},{417},
{423},{424},{425},{430},{431},
{432},{433},{435},{437},{441},
{443},{444},{446},{447},{448},
{452},{453},{454},{455},{456},
{457},{460},{461},{462},{463},
{464},{465},{468},{469},{471},
{472},{473},{476},{481},{484},
{485},{486},{487},{488},{493},
{497},{498},{501},{508},{509},
{510},{511},{512},{513},{514},
{515},{519},{520},{521},{522},
{523},{524},{530},{531},{532},
{539},{544},{548},{553},{556},
{557},{563},{564},{568},{571},
{572},{573},{574},{577},{578},
{581},{583},{586},{588},{592},
{593},{594},{595},{609}
};
forward Autocruise(playerid, in);
forward OpenExit(playerid);
forward EndWash(playerid);
forward Water(playerid, on);
public OnFilterScriptInit()
{
print(\"\\n-----------------------------------------------\");
print(\" \");
print(\"---=== Auto Mosó Filterscript ===---\");
print(\" \");
print(\"-------------- Copyright -- 2013 --------------\\n\");
entrancegate = CreateObject(17951,1911.21130371,-1780.68151855,14.15972233,0.00000000,0.00000000,90.00000000);
exitgate = CreateObject(17951,1911.21130371,-1771.97814941,14.15972233,0.00000000,0.00000000,90.00000000);
CreateObject(1250,1908.84997559,-1783.68945312,13.40625000,0.00000000,0.00000000,90.00000000);
CreatePickup(1239, 1, 1911.1886,-1784.2952,13.5, -1);
entrancetext = Create3DTextLabel(\"Senkisem használja a autómosót most.\\nÁr: $5 Parancs: (/carwash)\",0x008B00FF,1911.1886,-1784.2952,14.5,50,0,1);
return 1;
}
public OnFilterScriptExit()
{
DestroyObject(entrancegate);
DestroyObject(exitgate);
DestroyObject(3);
DestroyPickup(1);
Delete3DTextLabel(entrancetext);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPlayerVehicleID(i) == GetPlayerVehicleID(usingcarwash))
{
DestroyPlayerObject(i, water1);
DestroyPlayerObject(i, water2);
DestroyPlayerObject(i, water3);
DestroyPlayerObject(i, water4);
DestroyPlayerObject(i, water5);
DestroyPlayerObject(i, water6);
DestroyPlayerObject(i, water7);
TogglePlayerControllable(i, 1);
SetCameraBehindPlayer(i);
}
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
if(usingcarwash == playerid)
{
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
usingcarwash = -1;
Update3DTextLabelText(entrancetext, 0x008B00FF, \"Senkisem használja a autómosót.\\nÁra: $5 Parancs: (/carwash)\");
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(usingcarwash == playerid)
{
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
usingcarwash = -1;
Update3DTextLabelText(entrancetext, 0x008B00FF, \"Senkisem használja a autómosót.\\nÁr: $5 Parancs:(/carwash)\");
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(\"/carwash\", cmdtext, true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 5, 1911.1886,-1784.2952,13.0801))
{
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
for(new x = 0; x < sizeof(unwashable); x++)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == unwashable
{
SendClientMessage(playerid, 0xAA3333AA, \"Nem lehet ezt a jármûvet lemosni.\");
return 1;
}
}
if(GetMoney(playerid) > 4)
{
if(usingcarwash == -1)
{
GiveMoney(playerid,20000);
usingcarwash = playerid;
Update3DTextLabelText(entrancetext, 0xB0171FFF, \"Valaki használja autómosót.\");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
{
TogglePlayerControllable(i, 0);
SetPlayerCameraPos(i,1907.8804,-1790.0590,15);
SetPlayerCameraLookAt(i,1911.0471,-1781.6868,13.3828);
}
if(GetPlayerSurfingVehicleID(i) == GetPlayerVehicleID(playerid))
{
SetPlayerPos(i,1906.9204,-1786.0435,13.5469);
SetPlayerFacingAngle(i, 270);
}
}
SetVehiclePos(GetPlayerVehicleID(playerid), 1911.1886, -1784.2952, 13.0801);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0);
MoveObject(entrancegate, 1911.21130371, -1780.68151855, 10.50000000, 1);
SetTimerEx(\"Autocruise\",3500,0,\"ii\",playerid, 1);
}
else
{
SendClientMessage(playerid, 0xAA3333AA, \"Valaki használja autómosót.\");
}
}
else
{
SendClientMessage(playerid, 0xAA3333AA, \"Nincs elég pénzed!\");
}
}
else
{
SendClientMessage(playerid, 0xAA3333AA, \"Nem te vezeted a kocsit ezért nem tudod lemosni!\");
}
}
else
{
SendClientMessage(playerid, 0xAA3333AA, \"Nem vagy autóban!\");
}
}
else
{
SendClientMessage(playerid, 0xAA3333AA, \"Nem vagy a autómosó bejáratánl.\");
}
return 1;
}
return 0;
}
public Autocruise(playerid, in)
{
new Float:vehx, Float:vehy, Float:vehz;
GetVehiclePos(GetPlayerVehicleID(playerid), vehx, vehy, vehz);
if(in == 1)
{
if(-1777 < vehy)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
{
SetPlayerCameraPos(i,1910.4637,-1771.8,15);
SetPlayerCameraLookAt(i,1911.2863,-1775.1614,13.3828);
}
}
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0);
TogglePlayerControllable(playerid, 0);
MoveObject(entrancegate, 1911.21130371, -1780.68151855, 14.15972233, 1);
SetTimerEx(\"Water\",4000,0,\"ii\",playerid, 1);
}
else
{
if(vehx != 1911.1886)
{
SetVehiclePos(GetPlayerVehicleID(playerid), 1911.1886, vehy, vehz);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0);
}
TogglePlayerControllable(playerid, 1);
SetVehicleVelocity(GetPlayerVehicleID(playerid), 0, 0.1, 0);
SetTimerEx(\"Autocruise\",100,0,\"ii\",playerid, 1);
}
}
else
{
if(-1768 < vehy)
{
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0);
TogglePlayerControllable(playerid, 0);
MoveObject(exitgate, 1911.21130371,-1771.97814941,14.15972233, 1);
SetTimerEx(\"EndWash\",1000,0,\"i\",playerid);
}
else
{
if(vehx != 1911.1886)
{
SetVehiclePos(GetPlayerVehicleID(playerid), 1911.1886, vehy, vehz);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0);
}
TogglePlayerControllable(playerid, 1);
SetVehicleVelocity(GetPlayerVehicleID(playerid), 0, 0.1, 0);
SetTimerEx(\"Autocruise\",100,0,\"ii\",playerid, 0);
}
}
return 1;
}
public Water(playerid, on)
{
if(on == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
{
DestroyPlayerObject(i, water1);
DestroyPlayerObject(i, water2);
DestroyPlayerObject(i, water3);
DestroyPlayerObject(i, water4);
DestroyPlayerObject(i, water5);
DestroyPlayerObject(i, water6);
DestroyPlayerObject(i, water7);
SetTimerEx(\"OpenExit\",500,0,\"i\",playerid);
}
}
}
else
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
{
water1 = CreatePlayerObject(i, 18747, 1911, -1776, 10, 0, 0, 90);
water2 = CreatePlayerObject(i, 18747, 1914, -1776, 10, 0, 0, 90);
water3 = CreatePlayerObject(i, 18739, 1910.1821, -1777.8997, 25, 0, 180, 0);
water4 = CreatePlayerObject(i, 18739, 1910.1821, -1774.8132, 25, 0, 180, 0);
water5 = CreatePlayerObject(i, 18739, 1912.1490, -1774.8132, 25, 0, 180, 0);
water6 = CreatePlayerObject(i, 18739, 1912.1490, -1777.8997, 25, 0, 180, 0);
water7 = CreatePlayerObject(i, 18739, 1911.2194, -1776.5117, 25, 0, 180, 0);
SetTimerEx(\"Water\",15000,0,\"ii\",playerid, 0);
}
}
}
return 1;
}
public OpenExit(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
{
SetPlayerCameraPos(i,1909.0697,-1760.7429,15);
SetPlayerCameraLookAt(i,1911.2600,-1771.5955,13.3828);
}
}
MoveObject(exitgate, 1911.21130371, -1771.97814941, 10.50000000, 1);
SetTimerEx(\"Autocruise\",3500,0,\"ii\",playerid, 0);
return 1;
}
public EndWash(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
{
TogglePlayerControllable(i, 1);
SetCameraBehindPlayer(i);
}
}
usingcarwash = -1;
Update3DTextLabelText(entrancetext, 0x008B00FF, \"Senkisem használja a autómosót most.\\nÁr: $5 Parancs: (/carwash)\");
return 1;
}
stock PenzLevesz(playerid, penz)
{
new penze = VanEnnyiPenze(playerid, penz);
if(penze == 0) return false;
else if(penze == 1) GiveMoney(playerid, -penz);
else if(penze == 2) PlayerInfo[playerid][pAccount] -= penz;
return true;
}
stock VanEnnyiPenze(playerid, penz)
{
if(GetMoney(playerid) >= penz)
return 1;
else if(PlayerInfo[playerid][pAccount] >= penz)
return 2;
return 0;
}