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; }
Originally Posted by gnorby88
No Error! The command work, but not correctly.
Doesn't write the crime. |
dcmd_911(playerid, params[]) { new giveplayerid,string; if (!sscanf(params, "ds", giveplayerid, string)){ SendClientMessage(playerid, 0xFF0000FF, "[INFO] USAGE: /911 [plyerid] [Crime]"); }else{ if (IsPlayerConnected(giveplayerid)) { new rname[256]; new cname[256]; GetPlayerName(playerid, rname, sizeof(rname)); GetPlayerName(giveplayerid, cname, sizeof(rname)); new temp[256]; format(temp, sizeof(temp), "[RADIO] %s reported %s %s",rname,cname, string); SendClientMessageToAll(COLOR_YELLOW,temp); }else{ SendClientMessage(playerid, 0xFF0000FF, "[INFO] Wrong ID"); } } return 1; }
if(strcmp(cmd, "/911", true) == 0)
{
new tmp[128];
new tmp2[128];
new crime;
tmp = strtok(cmdtext, idx);
tmp2 = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /911 [ID] [CRIME]");
if(!strlen(tmp2)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /911 [ID] [CRIME]");
giveplayerid = strval(tmp);
crime= strval(tmp2);
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;
}