Playerid for ongamemodeinit
#1

So, I have a bug that when someone joins the server, gets spammed by my acceptdeath system. I'm trying to fix that by making it so when they join the server,

Код:
 Dead[playerid] = 0
But what would I put here?

Код:
new playerid = ???
What would I define for THEIR playerid?
Reply
#2

You can either do this
pawn Код:
for (new i = 0; i < MAX_PLAYERS; i ++)
{
Dead[i] = 0;
}
or
pawn Код:
// under onplayerconnect
Dead[playerid] = 0;
Or don't care. Variables are automatically set to zero when player joins / game mode starts.
OnGameModeInit is called ONLY when you start the gamemode not when you connect.
Reply
#3

Quote:
Originally Posted by admantis
Посмотреть сообщение
Variables are automatically set to zero when player joins
False. I've had problems due to forgetting to set variables back to 0 when player connects.
However when the script starts it does.
Reply
#4

Thanks! OnPlayerConnect works. Now just gotta upload it, and hope it works.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)