LorD. Posted April 8, 2016 Report Share Posted April 8, 2016 (edited) Salut , am o mica problema la comanda /arrest, am incercat in toate felurile s-o rezolv si n-am reusit. Daca ma puteti ajuta sa fac in asa fel incat cand scriu /arrest la Jail , sa aresteze acel player doar daca este langa mine. Ca , comanda e facuta fara acel "if" , daca dau /arrest il aresteaza pe player si daca este in orasul celalalt, eu doar dand /arrest Daca aveti nevoie de altceva inafara de comanda dati reply. Spoiler CMD:arrest(playerid, params[]) { new id, sendername[64], giveplayer[64], string[256], bail, bailprice, time; if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pLeader] == 2) { if(sscanf(params, "u", id)) { SendClientMessage(playerid, COLOR_WHITE, "{CCFF99}Syntax:{FFFFFF} /arrest [PlayerID/PartOfName]"); return 1; } if(id != INVALID_PLAYER_ID) { if(!PlayerToPoint(5.6, playerid, 1525.7203,-1677.9719,5.8906) && !ProxDetectorS(6.1, playerid, id)) return SCM(playerid, COLOR_WHITE, "Nu esti langa Jail sau jucatorul ales nu este langa acesta!"); if(OnDuty[playerid] == 0) return SCM(playerid, COLOR_WHITE, "Trebuie sa fii politist On-Duty!"); if(id == playerid) return SCM(playerid, COLOR_WHITE, "This player is offline!"); if(id == playerid) return SCM(playerid, COLOR_WHITE, "This player is offline!"); else if(WantedLevel[id] == 1) { bail = 10000; bailprice = 100000; time = 1; } else if(WantedLevel[id] == 2) { bail = 20000; bailprice = 200000; time = 2; } else if(WantedLevel[id] == 3) { bail = 30000; bailprice = 300000; time = 3; } else { SCM(playerid, COLOR_WHITE, "Acest player nu are WANTED sau nu are drept de predare!"); return 1; } GetPlayerName(playerid, sendername, 64); GetPlayerName(id, giveplayer, 64); PlayerInfo[id][pJailTime] = time * 60; PlayerInfo[id][pJailed] = 1; WantedLevel[id] = 0; SetPlayerWantedLevel(id, 0); GivePlayerMoney(id, -bail); SpawnPlayer(id); if(PlayerInfo[playerid][pMember]== 1 || PlayerInfo[playerid][pLeader]== 1) { format(string, sizeof(string), "<< Ofiter-ul %s a arestat suspectul %s pentru %d secunde (%s). Cautiune: %s >>", sendername, giveplayer, time * 60, FormatMoney(bail), FormatMoney(bailprice) ); OOCNews(COLOR_LIGHTRED, string); } else if(PlayerInfo[playerid][pMember]== 2 || PlayerInfo[playerid][pLeader]== 2) { format(string, sizeof(string), "<< Agentul Fbi %s a arestat suspectul %s pentru %d secunde (%s). Cautiune: %s >>", sendername, giveplayer, time * 60, FormatMoney(bail), FormatMoney(bailprice)); OOCNews(COLOR_LIGHTRED, string); } else if(PlayerInfo[playerid][pMember]== 3 || PlayerInfo[playerid][pLeader]== 3) { format(string, sizeof(string), "<< Soldatul %s a arestat suspectul %s pentru %d secunde ($%s). Cautiune: $%s >>", sendername, giveplayer, time * 60, FormatMoney(bail), FormatMoney(bailprice)); OOCNews(COLOR_LIGHTRED, string); } } else return SCM(playerid, COLOR_WHITE, "This player is offline!"); } else return SCM(playerid, COLOR_WHITE, "Nu esti autorizat pentru a folosi aceasta comanda!"); } return 1; } EDIT: Am vazut ca exista asta : Dar cum fac ca playerul cu wanted sa poata fii arestat doar daca este langa jail/mine. Spoiler if(!PlayerToPoint(5.6, playerid, 1525.7203,-1677.9719,5.8906) && !ProxDetectorS(6.1, playerid, id)) return SCM(playerid, COLOR_WHITE, "Nu esti langa Jail sau jucatorul ales nu este langa acesta!"); Edited April 8, 2016 by LorD. EDIT Quote Link to comment Share on other sites More sharing options...
MrAndyAdv Posted April 8, 2016 Report Share Posted April 8, 2016 Daca ai un jail si unde trebuie sa se teleporteze player-ul va merge. Quote Achivments: *TOP 5 CONTRIBUITORI <3* Link to comment Share on other sites More sharing options...
LorD. Posted April 8, 2016 Author Report Share Posted April 8, 2016 Boss,daca nu stii la ce ma refer , taci. Comanda merge perfect , doar ca atunci cand dau /arrest BoBo (Ex) si el e in SF , eu sunt in parcare LSPD unde este jail-ul, eu il pot aresta. Asa ca te rog eu taci si nu mai pune comentarii doar sa ai tu posturi in plus. Eu m-am referit ca vreau sa ma ajutati ca atunci cand sa dau /arrest sa nu pot sa-l arestez pe player decat daca e langa mine,nu la 1000km distanta. Quote Link to comment Share on other sites More sharing options...
xpLode Posted April 8, 2016 Report Share Posted April 8, 2016 (edited) new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); if(IsPlayerInRangeOfPoint(id, 4, x, y, z)) return SendClientMessage(playerid, -1, "Playerul nu este langa tine!"); Have fun. Edited April 8, 2016 by xpLode Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.