Help with Event System
#1

Hey,

I'm current in process of making an Event System. I've already made the basic commands like /startev /openev /closeev /finishev. But I came across a problem recently when I was trying to send a message to everyone in the Event that the player is joining.

When an Admin starts an event, people will have to join using /join [ID]. ID as in the playerid of the Admin who created the event. Multiple events can be created at the same time by different players. But that's the problem. If I was going make an event kick command for the Event Creator to kick people out of their event, how can I only let him/her kick people from their own event and not other events. So if I was creating a loop to send messages to people in the event a player was joining, how could I make it so it would only send to the people in THAT event only and not people in other different events.

Here are the variables for the event,

pawn Код:
new
    EventOpen[MAX_PLAYERS],
    InEvent[MAX_PLAYERS],
    EventOwner[MAX_PLAYERS],
    Float:EventPos[MAX_PLAYERS][4],
    EventInt[MAX_PLAYERS],
    EventVW[MAX_PLAYERS];
And the join command,

pawn Код:
CMD:join(playerid, params[])
{
    new id;

    if(sscanf(params, "u", id) )
        return SendUsageError( playerid, "/join [ID]" );

    if ( id == INVALID_PLAYER_ID )
        return InvalidPlayerError( playerid );

    if( EventOpen[id] == 0 )
        return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} Teleports to the Event have been disabled!");

    if( EventOwner[id] == 0 )
        return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} This user has not started an Event");

    SetPlayerPos(playerid, EventPos[id][0], EventPos[id][1], EventPos[id][2]);
    SetPlayerFacingAngle(playerid, EventPos[id][3]);
    SetPlayerInterior(playerid, EventInt[id]);
    SetPlayerVirtualWorld(playerid, EventVW[id]);
    InEvent[playerid] = 1;

    SendClientMessage(playerid, 0xFFA200FF, "[EVENT] You have joined an Event, use /exit to leave");
    return 1;
}
How am I able to fix this?

Thanks,

FunnyBear
Reply


Messages In This Thread
Help with Event System - by FunnyBear - 17.01.2015, 18:33
Re: Help with Event System - by Misiur - 17.01.2015, 21:14

Forum Jump:


Users browsing this thread: 1 Guest(s)