04.01.2013, 21:17
use this
I use it in my rpg gm, I edited it a bit, now working more faster and more easy to use, use here
this will send player's message to everybody who arond 20 radian
if you need more scripts like this then I can offer you some of them
almost all is made by me or edited by me to make more easy to use or faster to work
pawn Код:
forward ProxDetector(Float:radi, playerid, const string[],const color);
public ProxDetector(Float:radi, playerid, const string[],const color)
{
if(IsPlayerConnected(playerid))
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
new kMessage =0;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
{
SendClientMessage(i, color, string);
kMessage++;
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
SendClientMessage(i, color, string);
kMessage++;
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
SendClientMessage(i, color, string);
kMessage++;
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
SendClientMessage(i, color, string);
kMessage++;
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
SendClientMessage(i, color, string);
kMessage++;
}
}
}
if(kMessage == 1)
{
SendClientMessage(playerid,0xFFFFFFFF,"( ! ) Nobody is around to hear you");
}
}//not connected
return 1;
}
pawn Код:
public OnPlayerText(playerid, text[])
{
new string[256];
format(string,256,"%s: %s",PlayerName(playerid),text);
ProxDetector(20.0,playerid,string,GetPlayerColor(playerid));
return 0; // here should be zero but no one
}
if you need more scripts like this then I can offer you some of them
Код:
native CleanPlayerChat(playerid); native CheckIPAdversting(string[]); native GetPlayerID(const name[]); native GetPlayerIDFromIP(ip[]); native GetPlayerVehicleSpeed(playerid); native GetPlayerTownName(playerid); native GivePlayerArmour(playerid,Float:armour); native GivePlayerArmourEx(playerid,Float:armour); native GivePlayerDrunkLevel(playerid,level); native GivePlayerHealth(playerid,Float:health); native GivePlayerHealthEx(playerid,Float:health); native GivePlayerScore(playerid,score); native GivePlayerWantedLevel(playerid,level); native HexToInt(string[]); native IsMail(string[]); native IsPlayerInArea(playerid,Float:max_x, Float:min_x, Float:max_y, Float:min_y); native IsPlayerMoving(playerid); native IsVehicleMoving(vehicleid); native PlayerName(playerid); native PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z); native ProxDetector(Float:radi, playerid, const string[], color); native SendClientMessageToAllEx(playerid,color,const string[]); native StopPlayerSound(playerid); native intstr(variable); native strfloat(Float:float); native split(const strsrc[], strdest[][], delimiter); native strmatch(const string1[], const string2[]); native strrest(const string[], &index); native strtok(const string[], &index,seperator=' '); native udb_hash(buf[]);