SA-MP Forums Archive
/911 problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /911 problem (/showthread.php?tid=131704)



/911 problem - gnorby88 - 04.03.2010

Hello. Have a /911 [id] [crime] command. But don't work.Doesn't write the crime. Why?
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;
	}



Re: /911 problem - gnorby88 - 04.03.2010

No Error! The command work, but not correctly.
Doesn't write the crime.


Re: /911 problem - Scenario - 04.03.2010

Quote:
Originally Posted by gnorby88
No Error! The command work, but not correctly.
Doesn't write the crime.
So, the command works, with no errors in PAWNO, but when you send in the Crime info, that won't show up? That sounds like a Team problem.


Re: /911 problem - gnorby88 - 04.03.2010

When i am use the command. etc. (id 2: nobody)
/911 2 some text
gnorby reported nobody
the crime not show! No Team!!!


Re: /911 problem - afei - 04.03.2010

It will not work to send the integer 'crime' by using %s..


Re: /911 problem - gnorby88 - 04.03.2010

I use %s. Or? What do you think? I don't understand. Help pls...


Re: /911 problem - gnorby88 - 05.03.2010

So. I probably this command in dcmd,but don't work.:
/911 2 text ---> wrong id!
/911 2 t
If only write one carachter (t), then work the command. But if write long text no work.
Nobody help. pls..

Код:
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;
}



Re: /911 problem - Oxside - 05.03.2010

https://sampwiki.blast.hk/wiki/Fast_Commands
Scroll down till you see a table about data types you see if you ust use %s or %d. etc..


Re: /911 problem - bajskorv123 - 05.03.2010

pawn Код:
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;
  }



Re: /911 problem - gnorby88 - 05.03.2010

Thx.