SetTimerEx problem
#1

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

Please, i need this before 7:55
Reply
#3

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

You need to make the function to stop spectating though.
Reply
#4

Can you please type in that function? Please,
Reply
#5

Please?
Reply
#6

pawn Код:
forward StopSpeccing(playerid);

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

public StopSpeccing(playerid)
{
    TogglePlayerSpectating(playerid, 0);
}
Reply
#7

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;

}

Reply
#8

Put the public StopSpeccing outside of OnPlayerDeath
Reply
#9

Aaah, that was stuppid Thanks alot!
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)