event system help
#2

pawn Код:
enum E_EVENT_INFO
{
    Float:eventX,
    Float:eventY,
    Float:eventZ,
    bool:eventOrganizer
}

new EventInfo[MAX_PLAYERS][E_EVENT_INFO];

CMD:startevent(playerid, params[])
{  
    foreach(new i : Player){
        if(EventInfo[i][eventOrganizer])
            // an event is already started, return something
    }
    EventInfo[playerid][eventOrganizer] = true;
    GetPlayerPos(playerid, EventInfo[playerid][eventX], EventInfo[playerid][eventY], EventInfo[playerid][eventZ]);
    return 1;
}


CMD:tpevent(playerid, params[])
{
    foreach(new i : Player){
        if(!EventInfo[i][eventOrganizer]) continue;
       
        return SetPlayerPos(playerid, EventInfo[i][eventX], EventInfo[i][eventY], EventInfo[i][eventZ]);
    }
    // no one has started any event
    return 1;
}
Allows only one event at once
Reply


Messages In This Thread
event system help - by bosmania - 14.03.2019, 14:00
Re: event system help - by TheToretto - 14.03.2019, 14:18
Re: event system help - by bosmania - 14.03.2019, 14:22
Re: event system help - by TheToretto - 14.03.2019, 14:24
Re: event system help - by bosmania - 14.03.2019, 14:45
Re: event system help - by Gameluner - 14.03.2019, 15:01
Re: event system help - by SymonClash - 14.03.2019, 20:15

Forum Jump:


Users browsing this thread: 1 Guest(s)