Pickups acting as other pickups [HELP] - 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)
+--- Thread: Pickups acting as other pickups [HELP] (
/showthread.php?tid=368134)
Pickups acting as other pickups [HELP] -
ShawtyyMacJunior - 12.08.2012
Why are my pickups not doing their codes i set for them, yet they do the code that i set for another pickup.
Heres the codes
Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == LVL2Pickup)
{
SetPlayerPos(playerid, 951.09997558594, 2144.1000976563, 1011);
GameTextForPlayer(playerid,"~r~I WANT TO PLAY A GAME",5000,5);
return 1;
}
if(pickupid == TrapPickup)
{
SetPlayerPos(playerid, 935.3141,2144.1475,1013.7524);
SetPlayerFacingAngle( playerid, 272.7581);
TogglePlayerControllable(playerid, 0);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
GameTextForPlayer(playerid,"~r~I WANT TO PLAY A GAME",5000,5);
SetCameraBehindPlayer(playerid);
DestroyPickup(TrapPickup);
return 1;
}
return 1;
}
Whats wrong with this?
Re: Pickups acting as other pickups [HELP] -
Ronaldo_raul™ - 12.08.2012
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == LVL2Pickup)
{
SetPlayerPos(playerid, 951.09997558594, 2144.1000976563, 1011);
GameTextForPlayer(playerid,"~r~I WANT TO PLAY A GAME",5000,5);
return 1;
}
if(pickupid == TrapPickup)
{
SetPlayerPos(playerid, 935.3141,2144.1475,1013.7524);
SetPlayerFacingAngle( playerid, 272.7581);
TogglePlayerControllable(playerid, 0);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
GameTextForPlayer(playerid,"~r~I WANT TO PLAY A GAME",5000,5);
SetCameraBehindPlayer(playerid);
DestroyPickup(TrapPickup);
return 1;
}
return 0; //You have to return 0 over here.
}
Re: Pickups acting as other pickups [HELP] -
Vince - 12.08.2012
If you are using AddStaticPickup, then change it to CreatePickup. AddStaticPickup doesn't return any value.