tele to chiliad after death for 10 seconds ?
#1

as the player dies ... then when he spawns he goes to chiliad ...and then after 10 seconds he respawns aat the normal place ...i tried a timer ..but it wasn't working for everyone .. it was working only for playerid 0.
Reply
#2

Use timer
Reply
#3

under OnPlayerDeath:
pawn Код:
SetPlayerSpawn(playerid, CHILLIADCOORDS);
SetTimerEx("Respawn", 10000, "i", 0, playerid);

---

forward Respawn(playerid);
public Respawn(playerid)
{
    SetPlayerPos(playerid, YOURNORMALPOSCOORDS");
    return 1;
}
Reply
#4

SA-MP timers are inefficient, use this instead:

pawn Код:
SetPlayerPos(playerid, chilliadcoords);
CreatePVarInt(playerid, "DeathTimer", gettime()+10);
And put this in OnPlayerUpdate:
pawn Код:
if(GetPVarInt(playerid, "DeathTimer"))
{
    if(GetPVarInt(playerid, "DeathTimer") < gettime())
    {
        SetPlayerPos(playerid, normal, spawn, coords);
        DeletePVar(playerid, "DeathTimer");
    }
}
Good luck
Reply
#5

nop,the pvar didnt work ...and the timer instead of spawning me .. it spawned another person ... so that way failed too,is there another way ?
Reply
#6

btw .. can anyone explain me whats the "gettime()" is for and the "+10" is for and when you get hte pvar why is it "< gettime() "?maybe i made them wrong ?and where do it put the .. setpvarinit ? on playerdeath ?
Reply
#7

anyone ?
Reply
#8

onplayerdeath
setplayerpos(chilliadpos)
settimer(timername,10000,true

public timername

code here
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)