Werid 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: Werid error: (
/showthread.php?tid=600179)
Werid error: -
izeatfishz - 04.02.2016
SendNearbyMessage(playerid, 15.0, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
number of arguments does not match definition
however:
stock SendNearbyMessage(playerid, Float:radius, string[], col1, col2, col3, col4, col5)
everything matches up fine? :c
Re: Werid error: -
Trucido - 04.02.2016
you copypasted something and it didnt work..?
post Sendnearbymessage func
Respuesta: Werid error: -
Swedky - 05.02.2016
Or just do this:
pawn Код:
new Float:Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
for(new i = 0; i <= GetPlayerPoolSize(); i++)
{
if(IsPlayerConnected(i) && GetPlayerDistanceFromPoint(i, Pos[0], Pos[1], Pos[2]) <= 15.0) SendClientMessage(i, COLOR_PURPLE, string);
}
Re: Werid error: -
GangstaSunny - 05.02.2016
Looks like the ProxDetector-Code.
Try to use this code instead. You can rename the stock.
PHP код:
stock ProxDetector(Float:radi, playerid, text[],col1,col2,col3,col4,col5)
{
if(IsPlayerConnected(playerid))
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
{
GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
{
SendClientMessage(i, col1, text);
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
SendClientMessage(i, col2, text);
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
SendClientMessage(i, col3, text);
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
SendClientMessage(i, col4, text);
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
SendClientMessage(i, col5, text);
}
}
}
}
}
return 1;
}