Error - 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)
+--- Thread: Error (
/showthread.php?tid=643063)
Error -
NitroZeth - 12.10.2017
error 035: argument type mismatch (argument 2)
Код:
CMD:call911(playerid,params[]) {
new string[128];
new dname[MAX_PLAYER_NAME], sw[120];
GetPlayerName(playerid, dname, sizeof(dname));
format(sw, sizeof(sw),"{3399FF}[Central Police Station] {FFFFFF}Thanks for calling 911, you will soon be served by a police officer, please wait.",dname);
SendClientMessage(blue2,sw);
format(string,sizeof(string),"{0985FA}[Police Central] {FFFFFF}Attention {3399FF}%s {FFFFFF}is calling 911, any officer available to answer the call.",dname,playerid,params);
MessageToAdmins(COLOR_WHITE,string);
return 1;
}
line :
Код:
SendClientMessage(blue2,sw);
why error?
Re: Error -
Kraeror - 12.10.2017
You forgot to define the playerid in sending the message to the player!
Just replace:
PHP код:
SendClientMessage(blue2,sw);
to
PHP код:
SendClientMessage(playerid, blue2,sw);
Re: Error -
Sew_Sumi - 12.10.2017
Quote:
Originally Posted by Lokii
I think your looking for this function:
PHP код:
SendClientMessageToAll(blue2, sw);
|
No, that's not what he's looking for, as that would be stupid to broadcast to everyone a message that's only supposed to be shown to the cop faction...