[HELP] Event System Detecting
#1

Well I need a way to detect if the player is in the event or not, so when I type the "/endevent" command it would remove weapons of everybody in the event and set their "PlayerInfo[playerid][pInEvent]" to 0.

Here's my /endevent command, tell me if you needed anything else.

pawn Код:
CMD:endevent(playerid, params[])
{
    if(!PlayerInfo[playerid][pLogged]) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You need to be logged in to excute a command.");
    if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You are not an admin.");
    if(IsPlayerConnected(playerid))
    {
        if(!EventInfo[eStarted]) return SendClientMessage(playerid, COLOR_GRAD1, "The event hasn't started yet.");
        EventInfo[eStarted] = 0;
        EventInfo[eLocked] = 0;
        EventInfo[eSlot1] = 0;
        EventInfo[eSlot2] = 0;
        EventInfo[eSlot3] = 0;
        EventInfo[eText] = 0;
        EventInfo[eX] = 0;
        EventInfo[eY] = 0;
        EventInfo[eZ] = 0;
        ResetPlayerWeapons(playerid); // This is supposed to reset everybody's weapons
        PlayerInfo[playerid][pInEvent] = 0; // This is supposed to be set to 0 for everybody in the event
        SendClientMessageToAll(COLOR_LIGHTBLUE, "The event has been finished.");
    }
    return 1;
}
Reply
#2

pawn Код:
for(new a = 0, b = GetMaxPlayers(); a < b; a++)
{
    if(PlayerInfo[a][pInEvent])
    {
        PlayerInfo[a][pInEvent] = 0;
        ResetPlayerWeapons(a);
    }
}
Reply
#3

Works, thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)