Adding Unlimited Nos. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Adding Unlimited Nos. (
/showthread.php?tid=264751)
Adding Unlimited Nos. -
M4z - 27.06.2011
http://pastebin.com/GjVrNnd4
ERRORS: C:\Users\M4z\Desktop\Pawno\gamemodes\FunServer.pwn (919) : error 017: undefined symbol "PRESSED"
C:\Users\M4z\Desktop\Pawno\gamemodes\FunServer.pwn (924) : error 017: undefined symbol "RELEASED"
Re: Adding Unlimited Nos. -
fiki574 - 27.06.2011
Look, just remove this (you really dont need this):
Код:
else if (RELEASED(KEY_FIRE))
{
if(IsPlayerInAnyVehicle(playerid))
RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1010);
}
And copy/paste the rest of code from:
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
To:
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
Should work! Here is my example:
Код:
if(PRESSED(KEY_FIRE))
{
for(new i = 0; i<MAX_PLAYERS; i++)
{
new vehicle = GetPlayerVehicleID(i);
AddVehicleComponent(vehicle, 1010);
}
}
return 1;
}
Re: Adding Unlimited Nos. -
Raimis_R - 27.06.2011
Add in the top of script
pawn Код:
#define PRESSED(%0)\
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
Edit: Wow to slow
Re: Adding Unlimited Nos. -
M4z - 27.06.2011
Wow, I just realised, its the wrong callback, fail..
Thanks for the information.