if joined == 1 Event is canceled
#1

Hello. i make a new fs but I have a problem. I want the event to be canceled only 1 person joined. but I couldn't already. understand my problem now;

OnPlayerUpdate public;
Код:
if(EventAttend == 1 && EventStarted == 1 && GetPVarInt(playerid,"PlayerinEvent") == 1)
{
new string[256];
new name[30];
GetPlayerName(playerid,name,30);
format(string,sizeof(string),"%s won the event prcie: $5.000",name);
SendClientMessageToAll(-1,string);
 EventStarted= 0;
EventAttend = 0;
GivePlayerMoney(playerid,50000);
SpawnPlayer(playerid);
EventisFinished = 0;
KillTimer(timer);
}
Please help i want is player joined the event but the event joined user = 1 the event is automatic finished. Sorry my bad english.
Reply
#2

Your variable is one for all player. Make variable: "new EventAttend[MAX_PLAYERS], EventStarted[MAX_PLAYERS];"
And you try this "if(EventAttend[playerid] == 1 && EventStarted[playerid] == 1 && GetPVarInt(playerid,"PlayerinEvent") == 1)"
Reply
#3

Quote:
Originally Posted by nike96
Посмотреть сообщение
Your variable is one for all player. Make variable: "new EventAttend[MAX_PLAYERS], EventStarted[MAX_PLAYERS];"
And you try this "if(EventAttend[playerid] == 1 && EventStarted[playerid] == 1 && GetPVarInt(playerid,"PlayerinEvent") == 1)"
Thank you. I try it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)