Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- YCMD:stop(playerid,params[],help)
- {
- new string [ 100 ];
- format(string, sizeof(string), "[POLICIJA]: Policajac zahtjeva za stanete uz cestu!");
- ProxDetector(20.0, playerid, string, 0xE6E6E6E6, 0xE6E6E6E6, 0xE6E6E6E6, 0xE6E6E6E6, 0xE6E6E6E6);
- return true;
- }
- forward ProxDetector(Float:p_radi, playerid, string[],col1,col2,col3,col4,col5);
- public ProxDetector(Float:p_radi, playerid, string[],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))
- {
- GetPlayerPos(i, posx, posy, posz);
- tempposx = (oldposx -posx);
- tempposy = (oldposy -posy);
- tempposz = (oldposz -posz);
- if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
- {
- if (((tempposx < p_radi/16) && (tempposx > -p_radi/16)) && ((tempposy < p_radi/16) && (tempposy > -p_radi/16)) && ((tempposz < p_radi/16) && (tempposz > -p_radi/16)))
- {
- SendClientMessage(i, col1, string);
- }
- else if (((tempposx < p_radi/8) && (tempposx > -p_radi/8)) && ((tempposy < p_radi/8) && (tempposy > -p_radi/8)) && ((tempposz < p_radi/8) && (tempposz > -p_radi/8)))
- {
- SendClientMessage(i, col2, string);
- }
- else if (((tempposx < p_radi/4) && (tempposx > -p_radi/4)) && ((tempposy < p_radi/4) && (tempposy > -p_radi/4)) && ((tempposz < p_radi/4) && (tempposz > -p_radi/4)))
- {
- SendClientMessage(i, col3, string);
- }
- else if (((tempposx < p_radi/2) && (tempposx > -p_radi/2)) && ((tempposy < p_radi/2) && (tempposy > -p_radi/2)) && ((tempposz < p_radi/2) && (tempposz > -p_radi/2)))
- {
- SendClientMessage(i, col4, string);
- }
- else if (((tempposx < p_radi) && (tempposx > -p_radi)) && ((tempposy < p_radi) && (tempposy > -p_radi)) && ((tempposz < p_radi) && (tempposz > -p_radi)))
- {
- SendClientMessage(i, col5, string);
- }
- }
- }
- }
- }
- return true;
- }
Add Comment
Please, Sign In to add comment