Warning with ProxDetector - 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: Warning with ProxDetector (
/showthread.php?tid=567321)
Warning with ProxDetector -
NinjahZ - 12.03.2015
I got a prox detector which is throwing Warnings, id believe its the proxdetector itself.
Код:
forward PlayerPlayerActionMessage(playerid,targetid,Float: radius,message[]);
public PlayerPlayerActionMessage(playerid,targetid,Float: radius,message[])
{
new ppamstring[128];
format(ppamstring,sizeof(ppamstring),"%s %s %s",GetPlayerName(playerid) ,message, GetPlayerName(targetid));//Line 2716
ProxDetector(20.0, playerid, ppamstring, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
Warnings are
Код:
(2716) : warning 202: number of arguments does not match definition
(2716) : warning 202: number of arguments does not match definition
(2716) : warning 202: number of arguments does not match definition
(2716) : warning 202: number of arguments does not match definition
The problem is the Prox Detector definition there, I think its a lil broken :/
Re: Warning with ProxDetector -
SickAttack - 12.03.2015
The problem isn't related to ProxDetector, it's related to "GetPlayerName(playerid)", you're using it wrong.
Correct usage:
pawn Код:
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
Re: Warning with ProxDetector -
X337 - 13.03.2015
^^ Right, You have mistake in GetPlayerName.
This is right code :
Код:
forward PlayerPlayerActionMessage(playerid,targetid,Float: radius,message[]);
public PlayerPlayerActionMessage(playerid,targetid,Float: radius,message[])
{
new ppamstring[128], name[MAX_PLAYER_NAME], tname[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
GetPlayerName(targetid, tname, MAX_PLAYER_NAME);
format(ppamstring,sizeof(ppamstring),"%s %s %s", name, message, tname);//Line 2716
ProxDetector(20.0, playerid, ppamstring, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}