20.08.2012, 05:31
Hello,
I am making 'events' filterscript. So you can have events in a server. This is my first attempt at scripting something that will actually have a function. Obviously if you do /joinevent when an event doesn't exist it should tell you, here is how I made it so it restricts when you from using the command while an event isn't present. Please tell me if there is a better way to do this, or if this will even work as I have not had time to test it yet.
I am making 'events' filterscript. So you can have events in a server. This is my first attempt at scripting something that will actually have a function. Obviously if you do /joinevent when an event doesn't exist it should tell you, here is how I made it so it restricts when you from using the command while an event isn't present. Please tell me if there is a better way to do this, or if this will even work as I have not had time to test it yet.
Код:
new JoinEvent = 0;
Код:
CMD:allowjoin(playerid, params[]) { if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_ORANGE, "ERROR: YOUR NOT LOGGED IN AS AN ADMIN!"); JoinEvent = JoinEvent + 1; SendClientMessageToAll(COLOR_GREEN, "An event has been started! Use /joinevent to join it!"); return 1; }
Код:
CMD:joinevent(playerid, params[]) { if(JoinEvent == 0) return SendClientMessage(playerid, COLOR_GREEN, "There is not event to join!"); if(JoinEvent == 1) return SendClientMessage(playerid, COLOR_GREEN, "You have joined the event!"); /// SOMETHING GOES HERE return 1; }