SA-MP Forums Archive
Commands for pickups - 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: Commands for pickups (/showthread.php?tid=249231)



Commands for pickups - NitoPSG - 17.04.2011

Guys I know how to set pickups in game but I don't know how to make a command that works only when player is on the pickup, I want the command to teleport player in other place, can someone tell me how to make that


Re: Commands for pickups - Sascha - 17.04.2011

try something like this:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp("/cmd", cmdtext, true, 4) == 0)
  {
    if(IsPlayerInRangeOfPoint(playerid, 1.5, X, Y. Z)) //Pickup coords
    {
      SetPlayerPos(playerid, x, y, z);
    }
    return 1;
  }
  return 0;
}



Re: Commands for pickups - Stigg - 17.04.2011

Try looking here:

https://sampwiki.blast.hk/wiki/Pickups


Re: Commands for pickups - nemesis_567 - 17.04.2011

You want the player to be teleported when he enters the pickup?
You could use the function OnPlayerPickupPickup. But I recommend what Sascha posted.