02.08.2010, 00:55
Quote:
if(slot == 1) or switch(slot) should work. Don't use stringcompare for integers.
|
I also tried switching between gunid & slot but nothing happens.
Simply nothing happens when I enter anything after /setevent weapons
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;
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(slot == 1)
{
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(slot == 2)
{
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(slot == 3)
{
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;
}