04.03.2010, 18:04
Hello. Have a /911 [id] [crime] command. But don't work.Doesn't write the crime. Why?
Sorry bad english.
The code:
Sorry bad english.
The code:
Код:
if(strcmp(cmd, "/911", true) == 0) { new tmp[256]; new crime; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /911 [ID] [CRIME]"); return 1; } giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /911 [ID] [CRIME]"); return 1; } crime= strval(tmp); if (IsPlayerConnected(giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "[RADIO] %s reported %s %s", sendername,giveplayer, crime); SendClientMessageToAll(COLOR_YELLOW, string); }else { format(string, sizeof(string), "%d : Wrong ID!", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; }