02.08.2010, 01:09
(
Последний раз редактировалось Dudits; 02.08.2010 в 02:43.
)
Quote:
Try this
pawn Код:
|
Edit: I removed the ! and it sent the message, lemme test if this works.
2x Edit: Yup works, <3
3x Edit: Well it only adds weapons to slot 1 when the !'s are removed, here's my code.
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[128];
if(sscanf(params, "s", eventrelated)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setevent [position - weapons]");
if(!strcmp(eventrelated, "position", true, 8))
{
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, 7))
{
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, 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(!strcmp(slot, "2", true, 1))
{
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, 1))
{
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;
}