Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ProxDetector(Float: radius, playerid, string[], col1, col2, col3, col4, col5) {
- new
- Float: x,
- Float: y,
- Float: z
- ;
- if(GetPlayerPos(playerid, x, y, z))
- {
- new
- interior = GetPlayerInterior(playerid),
- virtualworld = GetPlayerVirtualWorld(playerid)
- ;
- foreach(Player, i)
- {
- if((InsideShamal[playerid] == GetPlayerVehicleID(i) && GetPlayerState(i) == 2) || (InsideShamal[i] == GetPlayerVehicleID(playerid) && GetPlayerState(playerid) == 2) || (InsideShamal[playerid] != INVALID_VEHICLE_ID && InsideShamal[playerid] == InsideShamal[i]))
- {
- SendClientMessageEx(i, col1, string);
- }
- else if((GetPlayerInterior(i) == interior) && (GetPlayerVirtualWorld(i) == virtualworld))
- {
- switch(floatround((radius / GetPlayerDistanceFromPoint(i, x, y, z)), floatround_floor))
- {
- case 0: {} // not in range
- case 1: SendClientMessageEx(i, col5, string);
- case 2, 3: SendClientMessageEx(i, col4, string);
- case 4..7: SendClientMessageEx(i, col3, string);
- case 8..15: SendClientMessageEx(i, col2, string);
- default: SendClientMessageEx(i, col1, string); // 16 or over
- }
- }
- }
- return true;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment