simple antispawn help
#1

im not sure if i did this right but here is my issue. Im making an headshot system which works great but only one problem it kills the player still is the are still in anti-spawn protection mode. So i tried to if the player is in antispawn mode here is my checking code:

pawn Код:
OnPlayerSpawn
    antispawn[playerid] = 1;// now i created this so when the player spawns it is set to 1 so that means they are still in antispawn mode.

SetTimerEx("AntiSpawnkill",10000,0,"i",playerid);// then i run the timer which will set there health and armour back to normal after 10 seconds and turn off the antispawn mode (meaning restore antispawn back to 0).

public AntiSpawnkill(playerid)

SendClientMessage(playerid, red, "{F81414}Andre[BOT]: {FFFFFF}Anti-Spawnkill protection over, you are on your own now");
    antispawn[playerid] = 0;// restore the antispawn mode to 0
now here is the code i have for my headshot
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if(antispawn[playerid] == 1)// this is what i use to check if the player antispawn mode in on or off
    {
        GameTextForPlayer(issuerid, "Anti-Spawn Protected Player", 5000, 1);
    }
Reply
#2

Try returning 0

PHP код:
if(antispawn[playerid] == 1)// this is what i use to check if the player antispawn mode in on or off
    
{
         
GameTextForPlayer(issuerid"Anti-Spawn Protected Player"50001);
                return 
0;
     } 
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)