How to fix scripts that only work for id 0?
#1

So i'v made this anti spawn kill and it works fine untill it sets you back to 100 health, only id 0 gets changed back to 100 health, every other player stays at 9999 forever.


code:
Код:
forward AntKill(playerid);

label[playerid] = Create3DTextLabel("Anti Spawnkill",0x300FFAAB,30.0,40.0,50.0,40.0,0);
Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
SetPlayerHealth(playerid,9999999);
SetTimer("AntKill",15000,false);

public AntKill(playerid)
{
SetPlayerHealth(playerid,100.0);
Delete3DTextLabel(label[playerid]);
}
Reply
#2

own callbacks with parameters uses settimerex and not settimer...

delete the settimer line and add:

Код:
SetTimerEx("AntKill", 15000, false, "d", playerid);
Reply
#3

Actually SetTimerEx is a timer which you set for a player only. SetTimer is a global timer.
Reply
#4

Quote:
Originally Posted by Jochemd
Посмотреть сообщение
Actually SetTimerEx is a timer which you set for a player only. SetTimer is a global timer.
And then what about putting the SetTimerEx under his OnPlayerSpawn code?
Reply
#5

It won't work, just use SetTimerEx and thats it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)