SA-MP Forums Archive
help with scripting - 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 with scripting (/showthread.php?tid=90422)



help with scripting - miroku68 - 08.08.2009

The function you need help with: I made AddStaticPickup(1318,2,-2216.2722,2315.9092,7.5469); and when its picked up you go to SetPlayerPos(-2232.8948,2299.5195,19.8680);
Your problem with the function: I don't know how to pull that off any help or suggestions ? thanks



Re: help with scripting - coole210 - 08.08.2009

I don't understand what you mean but ill give a shot at it ? Do you want so if a player enters that static pickup his position changes? If so, here's the code...

pawn Код:
//TOP OF SCRIPT
new pickup1;
pawn Код:
//OnGameModeInIt
pickup1 = AddStaticPickup(1318,2,-2216.2722,2315.9092,7.5469);
pawn Код:
//OnPlayerPickupPickup
if(pickupid == pickup1)
{
SetPlayerPos(playerid,-2232.8948,2299.5195,19.8680);
}



Re: help with scripting - miroku68 - 08.08.2009

Yeah that's what I mean't thanks a lot time to test


Re: help with scripting - AcId n RaPiD - 08.08.2009

OnGameModeInit put this...

pawn Код:
AddStaticPickup(1239, 2, -2216.2722,2315.9092,7.5469);//My enter Pickup
On top of the script under the #define's, put this...

pawn Код:
forward CheckForWalkingTeleport(playerid);
Then put this anywhere in the script or in the bottom...

pawn Код:
public CheckForWalkingTeleport(playerid)
{
    new Float:cx, Float:cy, Float:cz;
    GetPlayerPos(playerid, cx, cy, cz);
   
    if(PlayerToPointStripped(1, playerid,-2216.2722,2315.9092,7.5469, cx,cy,cz))
    {//The Entrance
        GameTextForPlayer(playerid, "~w~MY ENTRANCE", 5000, 1);
        SetPlayerInterior(playerid, 6);
        SetPlayerPos(playerid,-2232.8948,2299.5195,19.8680);
        PlayerInfo[playerid][pInt] = 6;
    }
    return 1;
}