RP help! - 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: RP help! (
/showthread.php?tid=480483)
RP help! -
LostGaming2014 - 11.12.2013
Код:
public OnPlayerText(playerid, text[])
{
SendNearbyMessage(playerid, 10, string);
return 0;
}
Thats the code I'm using but It's giving me an error and I need a ICly chat!
Error:
Код:
C:\Users\****\Desktop\Not Giving A name\gamemodes\LVRP.pwn(86) : error 017: undefined symbol "SendNearbyMessage"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
Re: RP help! -
ZBits - 11.12.2013
Is your SendNerbyMessage defined?
Re: RP help! -
Zamora - 11.12.2013
Add this to your .pwn
pawn Код:
Stock SendNearbyMessage(playerid, Float:radius, string[], col1, col2, col3, col4, col5){ new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); new Float:ix, Float:iy, Float:iz; new Float:cx, Float:cy, Float:cz; foreach(Player, i) { if(IsPlayerLoggedIn{i}) { if(GetPlayerInterior(playerid) == GetPlayerInterior(i) && GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)) { GetPlayerPos(i, ix, iy, iz); cx = (x - ix); cy = (y - iy); cz = (z - iz); if(((cx < radius/16) && (cx > -radius/16)) && ((cy < radius/16) && (cy > -radius/16)) && ((cz < radius/16) && (cz > -radius/16))) { SendClientMessage(i, col1, string); } else if(((cx < radius/8) && (cx > -radius/8)) && ((cy < radius/8) && (cy > -radius/8)) && ((cz < radius/8) && (cz > -radius/8))) { SendClientMessage(i, col2, string); } else if(((cx < radius/4) && (cx > -radius/4)) && ((cy < radius/4) && (cy > -radius/4)) && ((cz < radius/4) && (cz > -radius/4))) { SendClientMessage(i, col3, string); } else if(((cx < radius/2) && (cx > -radius/2)) && ((cy < radius/2) && (cy > -radius/2)) && ((cz < radius/2) && (cz > -radius/2))) { SendClientMessage(i, col4, string); } else if(((cx < radius) && (cx > -radius)) && ((cy < radius) && (cy > -radius)) && ((cz < radius) && (cz > -radius))) { SendClientMessage(i, col5, string); } } } } return 1;}
Re: RP help! -
Tayab - 11.12.2013
Use this if you don't have foreach.
pawn Код:
stock SendNearByMessage(playerid,range,message[])
{
new Pos[3];
if(IsPlayerConnected(i))
for(new i = 0; i < MAX_PLAYERS; i++)
{
GetPlayerPos(playeid,Pos[0],Pos[1],Pos[2]);
if(IsPlayerInRangeOfPoint(i,range,Pos[0],Pos[1],Pos[2])
{
SendClientMessage(i,COLOR_WHITE,string);
}
}
return 1;
}
Re: RP help! -
Mafiya - 11.12.2013
Thanks I was looking for that
Re: RP help! -
LostGaming2014 - 11.12.2013
How do i define it?
Re: RP help! -
Zamora - 11.12.2013
Quote:
Originally Posted by LostGaming2014
How do i define it?
|
*facepalm*, Read my reply or Tayab's if you don't use foreach..!
Re: RP help! -
Tayab - 11.12.2013
Just paste it the bottom of the script, either Zamora's or my code and you should be good to go.