Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock ProxDetector(Float:range, playerid, text[], Color1, Color2, Color3, Color4, Color5)
- {
- new Float: Pos[3], Float: Radius;
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- for(new i = GetMaxPlayers() - 1; i != -1; i--)
- {
- if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
- {
- Radius = GetPlayerDistanceFromPoint(i, Pos[0], Pos[1], Pos[2]);
- if (Radius < range / 16) SendClientMessage(i, Color1, text);
- else if(Radius < range / 8) SendClientMessage(i, Color2, text);
- else if(Radius < range / 4) SendClientMessage(i, Color3, text);
- else if(Radius < range / 2) SendClientMessage(i, Color4, text);
- else if(Radius < range) SendClientMessage(i, Color5, text);
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement