HELP! CPS - 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: HELP! CPS (
/showthread.php?tid=64874)
HELP! CPS -
StrickenKid - 07.02.2009
plz someone fix my script!
Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == pcmoneypickup)
{
GivePlayerMoney(playerid, 20000);
GameTextForPlayer(playerid,"Found 20000!",3000,5);
return 1;
}
if(pickupid == pcheathpickup)
{
SetPlayerHealth(playerid,100);
GameTextForPlayer(playerid,"Found Some Health!",3000,5);
return 1;
}
if(pickupid == pcarmorpickup)
{
SetPlayerArmour(playerid,100);
GameTextForPlayer(playerid,"Found Some Armour!",3000,5);
return 1;
}
return 1;
}
for some reason the top 2 ones dont work and the last 1 does all the things the top 2 are suposed to do!
for examlple:
pcmoneypickup gives 20K
pcheathpickup gived 100 heath
pcarmorpickup gives 100 armour
BUT ONLY pcarmorpickup works and it gives 200K full armour and full heath!
PLZ HELP
EDIT: ALSO the reason i put CPS as the title i need help with CPS, once i go into a checkpoint it disapears so i can never go in it again how can i fix that?
Re: HELP! CPS -
Sandra18[NL] - 08.02.2009
Did you use "AddStaticPickup"??
In that case, use "CreatePickup" instead. Because AddStaticPickup does not return an ID.
Re: HELP! CPS -
chenza - 08.02.2009
If pickupid = 1242 will give armor 100. and pickupid = 1240 will give health 100 automatic.
If you use "AddStaticPickup" in you script will not go to "OnPlayerPickUpPickup"
Ps. sry, My english very bad.
thank
chenza
Re: HELP! CPS -
Mikep - 08.02.2009
https://sampwiki.blast.hk/wiki/PickupGuide