01.08.2010, 02:04
I'm trying to make an event system, everything is working fine but this.
I cannot enter anything after the "/setevent weapons" because for some reason it doesn't read it...
Note: It doesn't even send the ClientMessage of the slot
I cannot enter anything after the "/setevent weapons" because for some reason it doesn't read it...
pawn Код:
CMD:setevent(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(EventInfo[eStarted]) return SendClientMessage(playerid, COLOR_GRAD1, "You have already started the event.");
new eventrelated[24];
new slot[4];
new gunid;
new message[32];
if(sscanf(params, "s", eventrelated)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setevent [position - weapons]");
if(!strcmp(eventrelated, "position", true))
{
EventInfo[eInt] = GetPlayerInterior(playerid);
GetPlayerPos(playerid, EventInfo[eX], EventInfo[eY], EventInfo[eZ]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have set the event's starting position.");
}
else if(!strcmp(eventrelated, "weapons", true))
{
if(sscanf(params, "sii", eventrelated, gunid, slot)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setevent weapons [gun id] [slot(1-3)]");
if(!strcmp(slot, "1", true))
{
EventInfo[eSlot1] = gunid;
format(message, sizeof(message), "You have set the event's slot 1 gun to %s", gunid);
SendClientMessage(playerid, COLOR_LIGHTBLUE, message);
}
else if(!strcmp(slot, "2", true))
{
EventInfo[eSlot2] = gunid;
format(message, sizeof(message), "You have set the event's slot 2 gun to %s", gunid);
SendClientMessage(playerid, COLOR_LIGHTBLUE, message);
}
else if(!strcmp(slot, "3", true))
{
EventInfo[eSlot3] = gunid;
format(message, sizeof(message), "You have set the event's slot 3 gun to %s", gunid);
SendClientMessage(playerid, COLOR_LIGHTBLUE, message);
}
}
}
return 1;
}