30.09.2011, 20:51
pawn Code:
if(strcmp(cmd, "/evento", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new eventid[20], tmp[128];
tmp = strtok(cmdtext, idx);
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Necesitas ser RCON!");
if(!strlen(tmp))
{
SendClientMessage(playerid, -1, "Usage: /evento motos");
SendClientMessage(playerid, -1, "Usage: /evento amatar");
SendClientMessage(playerid, -1, "Usage: /evento autos");
SendClientMessage(playerid, -1, "Usage: /evento carrera");
return 1;
}
strmid(eventid, tmp, 0, strlen(cmdtext), 255);
if(strcmp(eventid, "motos", true, strlen(eventid)) == 0)
{
// Do your motos code
}
else if(strcmp(eventid, "amatar", true, strlen(eventid)) == 0)
{
// Do your amatar code
}
else if(strcmp(eventid, "autos", true, strlen(eventid)) == 0)
{
// Do your autos code
}
else if(strcmp(eventid, "carrera", true, strlen(eventid)) == 0)
{
// Do your carrera code
}
else return SendClientMessage(playerid, -1,"Unkown parameter! [Motos, Amatar, Autos, Carrera]");
}
return 1;
}