Anti-Spawn Kill Message Repeats twice
#1

Problem Solved
Reply
#2

Quote:
Originally Posted by pds2012
View Post
Everytime I spawn the message sends twice not once, I've been checking those two codes, and I haven't found the problem, I'm using y_timers

OnPlayerSpawn
pawn Code:
public OnPlayerSpawn(playerid)
{
    IsPlayerSpawn[playerid] = 1;
    SetPlayerSkin(playerid, PlayerSkin[playerid]);
    SetPlayerPos(playerid, 61.2377, -251.5834, 1.5781);

    //Anti Spawn Kill
    SetPlayerHealth(playerid, 9999);
    SetPlayerArmour(playerid, 9999);
   
    SendClientMessage(playerid, COLOR_WHITE, "["COL_DARKBLUE"ANTI SPAWN KILL"COL_WHITE"] - You're protected for 10 seconds, you have that time to choose your items(/guns & /vehicles)");
   
    SetPlayerChatBubble(playerid, "Anti Spawn Kill (Protected Player)", 0xFF0000AA, 100.0, 10000);
   
    defer AntiSpawnKill(playerid);
    return 1;
}
Timer Code
pawn Code:
timer AntiSpawnKill[10000](playerid)
{
    if(IsPlayerSpawn[playerid] == 1)
    {
        SetPlayerHealth(playerid, 100);
        SetPlayerArmour(playerid, 0);
        SendClientMessage(playerid, COLOR_WHITE, "["COL_DARKBLUE"ANTI SPAWN KILL"COL_WHITE"] - Anti Spawn Kill Is over, now it's time to kill some players!");
    }
    return 1;
}
This is how it looks like


PS: Noobish question, I know right , I'm just in a hurry
Under OnPlayerDeath, do you have OnPlayerSpawn(playerid) or SpawnPlayer(playerid)? Because then you're calling it twice.
Reply
#3

@DanishHaq No, I don't have SpawnPlayer(playerid) or OnPlayerSpawn(playerid)

But yes, I do use a Function SpawnPlayer, for my KillCamera and to skip the OnPlayerRequestClass
Reply
#4

And in any filterscripts? If not, try and use the standard SetTimerEx and see if that works instead of using y_timers or whatever you're using.
Reply
#5

DanishHaq I never use Filterscript, if I do have a favorite filterscript I found on forums, I automatically add it on my gamemode, Alright, I'll be testing SetTimerEx

EDIT: Even though I use SetTimerEx, the message executes twice for some reason, I've returned the SpawnPlayer(playerid) so it won't bug, but it is still the same.

2nd Edit: Fixed it, once again sorry for my noobish question .
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)