SA-MP Forums Archive
SetTimerEx problem - 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: SetTimerEx problem (/showthread.php?tid=90332)



SetTimerEx problem - urkiefly101 - 07.08.2009

hello, i've putted this

Quote:

TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, killerid);

under OnPlayerDeath, so when you die you spectate the player who killed you, but i can't manage to get the SetTimerEx to work properly. What do i need to put else so a player respawns after 10 seconds of death/spectating?


Re: SetTimerEx problem - urkiefly101 - 07.08.2009

Please, i need this before 7:55


Re: SetTimerEx problem - SpiderPork - 07.08.2009

SetTimerEx(FunctionName, 10000, 0, "i", playerid);

You need to make the function to stop spectating though.


Re: SetTimerEx problem - urkiefly101 - 07.08.2009

Can you please type in that function? Please,


Re: SetTimerEx problem - TheKingWillem - 07.08.2009

Please?


Re: SetTimerEx problem - MadeMan - 07.08.2009

pawn Код:
forward StopSpeccing(playerid);

//Under OnPlayerDeath
SetTimerEx("StopSpeccing", 10000, false, "i", playerid);

public StopSpeccing(playerid)
{
    TogglePlayerSpectating(playerid, 0);
}



Re: SetTimerEx problem - TheKingWillem - 07.08.2009

Quote:

C:\Program Files (x86)\Rockstar Games\GTA San Andreas\samp02Xserver.win32[1]\gamemodes\sftdm4.6.1.pwn(841) : error 029: invalid expression, assumed zero
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\samp02Xserver.win32[1]\gamemodes\sftdm4.6.1.pwn(841) : error 004: function "StopSpeccing" is not implemented

??

this is what i've got now

Quote:

public OnPlayerDeath(playerid, killerid, reason)

{

TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, killerid);
SetTimerEx("StopSpeccing", 10000, false, "i", playerid);

public StopSpeccing(playerid)
{
TogglePlayerSpectating(playerid, 0);
}

if(killerid == INVALID_PLAYER_ID) {

SendDeathMessage(INVALID_PLAYER_ID,playerid,reason );



} else {



if(gTeam[killerid] != gTeam[playerid]) {

// Valid kill

SendDeathMessage(killerid,playerid,reason);

SetPlayerScore(killerid,GetPlayerScore(killerid)+1 );

GivePlayerMoney(killerid, 1000);


}

}

return 1;

}




Re: SetTimerEx problem - MadeMan - 07.08.2009

Put the public StopSpeccing outside of OnPlayerDeath


Re: SetTimerEx problem - TheKingWillem - 07.08.2009

Aaah, that was stuppid Thanks alot!


Re: SetTimerEx problem - TheKingWillem - 07.08.2009

Never mind, it doesn't respawn... when i type /kill it just looks over the sky without respwaning.