help with scripting
#1

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
Reply
#2

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);
}
Reply
#3

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

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;
}
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)