LorD.
-
Posts
32 -
Joined
-
Last visited
Content Type
Profiles
Forums
News
Documentation
Posts posted by LorD.
-
-
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.
SpoilerCMD: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.
Spoilerif(!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!");
-
Spoiler
C:\Documents and Settings\Administrator\My Documents\RPG LorD\gamemodes\gamemode.pwn(24665) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrator\My Documents\RPG LorD\gamemodes\gamemode.pwn(24665) : warning 215: expression has no effect
C:\Documents and Settings\Administrator\My Documents\RPG LorD\gamemodes\gamemode.pwn(24665) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Administrator\My Documents\RPG LorD\gamemodes\gamemode.pwn(24665) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrator\My Documents\RPG LorD\gamemodes\gamemode.pwn(24665) : fatal error 107: too many error messages on one lineImi da alte erori
Am rezolvat , mersi mult merge perfect.
-
@Extremys Ma poti ajuta cu erorile de mai sus?
-
Spoiler
C:\Documents and Settings\Administrator\My Documents\RPG LorD\gamemodes\gamemode.pwn(748) : error 020: invalid symbol name ""
C:\Documents and Settings\Administrator\My Documents\RPG LorD\gamemodes\gamemode.pwn(19732) : error 017: undefined symbol "Logs"
C:\Documents and Settings\Administrator\My Documents\RPG LorD\gamemodes\gamemode.pwn(19732) : warning 215: expression has no effect
C:\Documents and Settings\Administrator\My Documents\RPG LorD\gamemodes\gamemode.pwn(19732) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Administrator\My Documents\RPG LorD\gamemodes\gamemode.pwn(19732) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrator\My Documents\RPG LorD\gamemodes\gamemode.pwn(19732) : fatal error 107: too many error messages on one lineCompilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
5 Errors.am facut cum ai zis @Extremys si imi da erorile astea.
-
De 2 saptamani caut pe net cum sa-mi fac o comanda /flymode pentru gamemode-ul meu. N-am gasit nimic...
Va rog mult, daca ma puteti ajuta sa imi fac o comanda /flymode pentru admini sa le permita sa zboare.Aici aveti gamemode-ul meu
-
Acum 14 minute, xpLode a spus:
OnPlayerKeyStateChange pui asta:
if(newkeys & KEY_NO) { if(IsPlayerConnected(playerid)) { new ivID = GetClosestVehicleToPlayer(playerid); new namee[MAX_PLAYER_NAME]; GetPlayerName(playerid, namee, sizeof(namee)); if(PlayerInfo[playerid][pPcarkey] == ivID || PlayerInfo[playerid][pPcarkey2] == ivID || PlayerInfo[playerid][pPcarkey3] == ivID) { if(GetClosestVehicleToPlayer(playerid) > 5.0) { if(CarInfo[ivID][cLock] == ) { CarInfo[ivID][cLock] = 1; format(string, sizeof(string), "%s~n~~r~Locked",CarInfo[ivID][cDescription]); GameTextForPlayer(playerid, string, 3000, 3); GetVehicleParamsEx(ivID,engine,lights,alarm,doors,bonnet,boot,objective); SetVehicleParamsEx(ivID,engine,lights,alarm,1,bonnet,boot,objective); } if(CarInfo[ivID][cLock] == 1) { CarInfo[ivID][cLock] = ; format(string, sizeof(string), "%s~n~~g~Unlocked",CarInfo[ivID][cDescription]); GameTextForPlayer(playerid, string, 3000, 3); GetVehicleParamsEx(ivID,engine,lights,alarm,doors,bonnet,boot,objective); SetVehicleParamsEx(ivID,engine,lights,alarm,,bonnet,boot,objective); } } } } }
Cand apasa N doar mi-o descuie, nu o incuie,nu conteaza mi-a rezolvat problam @Extremys
Acum 10 minute, Extremys a spus:Compileaza.l pe acesta.
Mersi mult, merge perfect
-
uite gamemode-ul , eu l-am scris exact acolo unde mi-ai zis , la onplayer blablabla.. ultimul
-
Daca sterg ce mi-ai dat si compilez scrie asa
SpoilerPawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
Header size: 13492 bytes
Code size: 2721176 bytes
Data size: 3669376 bytes
Stack/heap size: 16384 bytes; estimated max. usage: unknown, due to recursion
Total requirements: 6420428 bytes -
Deci am pus ce mi-ai dat la onplayerstatechenge si am dat sa-l compilez si dupa ce s-a terminat de compilat imi zice asa:
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
Si fisierul .amx care s-a facut are 0 bytes
-
Nu prea am inteles nimic din ce mi-ai explicat...
Adaug la OnPlayerKeyStateChangeAcum 42 minute, Extremys a spus:if(newkeys == KEY_NO)
{new ivID = GetClosestVehicleToPlayer(playerid);
new namee[MAX_PLAYER_NAME];
GetPlayerName(playerid, namee, sizeof(namee));
if(PlayerInfo[playerid][pPcarkey] == ivID || PlayerInfo[playerid][pPcarkey2] == ivID || PlayerInfo[playerid][pPcarkey3] == ivID)
{
// if(strcmp(namee,CarInfo[idcar][cOwner], true) == 0)
// {
if(GetClosestVehicleToPlayer(playerid) > 5.0)
{
if(CarInfo[ivID][cLock] == 0)
{
//CarInfo[idcar][cLock] = 1;
CarInfo[ivID][cLock] = 1;
format(string, sizeof(string), "%s~n~~r~Locked",CarInfo[ivID][cDescription]);
GameTextForPlayer(playerid, string, 3000, 3);
GetVehicleParamsEx(ivID,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(ivID,engine,lights,alarm,1,bonnet,boot,objective);
//OnCarUpdate();
return 1;
}
if(CarInfo[ivID][cLock] == 1)
{
//CarInfo[idcar][cLock] = 0;
CarInfo[ivID][cLock] = 0;
format(string, sizeof(string), "%s~n~~g~Unlocked",CarInfo[ivID][cDescription]);
GameTextForPlayer(playerid, string, 3000, 3);
GetVehicleParamsEx(ivID,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(ivID,engine,lights,alarm,0,bonnet,boot,objective);
//OnCarUpdate();
return 1;
}
}
}
return 1;
}Si atat? Nu mai am nimic cu KEY_NO , am cautat cu CTRL+F.
Spune-mi mai explicit, unde si ce pun.
-
Salut, am o intrebare . Am comanda /lock care incuie si descuie usa la masina, cum pot face comanda sa aiba un HotKey pe tasta N , de exemplu apesi N si foloseste comanda /lock, nu cred ca va trebuie prea multe detalii , stiti la ce ma refer.
Spoilerif(strcmp(cmd, "/lock", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new ivID = GetClosestVehicleToPlayer(playerid);
new namee[MAX_PLAYER_NAME];
GetPlayerName(playerid, namee, sizeof(namee));
if(PlayerInfo[playerid][pPcarkey] == ivID || PlayerInfo[playerid][pPcarkey2] == ivID || PlayerInfo[playerid][pPcarkey3] == ivID)
{
// if(strcmp(namee,CarInfo[idcar][cOwner], true) == 0)
// {
if(GetClosestVehicleToPlayer(playerid) > 5.0)
{
if(CarInfo[ivID][cLock] == 0)
{
//CarInfo[idcar][cLock] = 1;
CarInfo[ivID][cLock] = 1;
format(string, sizeof(string), "%s~n~~r~Locked",CarInfo[ivID][cDescription]);
GameTextForPlayer(playerid, string, 3000, 3);
GetVehicleParamsEx(ivID,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(ivID,engine,lights,alarm,1,bonnet,boot,objective);
//OnCarUpdate();
return 1;
}
if(CarInfo[ivID][cLock] == 1)
{
//CarInfo[idcar][cLock] = 0;
CarInfo[ivID][cLock] = 0;
format(string, sizeof(string), "%s~n~~g~Unlocked",CarInfo[ivID][cDescription]);
GameTextForPlayer(playerid, string, 3000, 3);
GetVehicleParamsEx(ivID,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(ivID,engine,lights,alarm,0,bonnet,boot,objective);
//OnCarUpdate();
return 1;
}
}
}
return 1;
}
} -
si eu am numit baza de date , basadate ,care-i problema?:|
Doamnee, ce scripteri mari sunteti voi daca stau de 2 ore sa ma ajutati sa pun un amarat de cacat?
va dati mari si la altii ca aveti gamemode-uri misto, 100% facute de voi. Va curg mucii la nas si intrati pe sa-mp.ro si va dati mari. -
Ma puteti ajuta???
am facut exact asa
#define SQL_HOST "127.0.0.1"
#define SQL_USER "root"
#define SQL_PASS " "
#define SQL_DB "basadate"si imi da asta
SpoilerC:\Documents and Settings\Administrator\My Documents\RPG LorD\gamemodes\gamemode.pwn(42036) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Administrator\My Documents\RPG LorD\gamemodes\gamemode.pwn(42036) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrator\My Documents\RPG LorD\gamemodes\gamemode.pwn(42036) : warning 215: expression has no effect
C:\Documents and Settings\Administrator\My Documents\RPG LorD\gamemodes\gamemode.pwn(42036) : error 017: undefined symbol "root"
C:\Documents and Settings\Administrator\My Documents\RPG LorD\gamemodes\gamemode.pwn(42036) : fatal error 107: too many error messages on one line -
am pus cum ai zis tu
exacta asa:
#define SQL_HOST "127.0.0.1"
#define SQL_USER "root"
#define SQL_PASS " "
#define SQL_DB "database"si imi da erorile astea
EDIT: Eroare noua:
am facut exact asa
#define SQL_HOST "127.0.0.1"
#define SQL_USER "root"
#define SQL_PASS " "
#define SQL_DB "basadate"SpoilerC:\Documents and Settings\Administrator\My Documents\RPG LorD\gamemodes\gamemode.pwn(42036) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Administrator\My Documents\RPG LorD\gamemodes\gamemode.pwn(42036) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrator\My Documents\RPG LorD\gamemodes\gamemode.pwn(42036) : warning 215: expression has no effect
C:\Documents and Settings\Administrator\My Documents\RPG LorD\gamemodes\gamemode.pwn(42036) : error 017: undefined symbol "root"
C:\Documents and Settings\Administrator\My Documents\RPG LorD\gamemodes\gamemode.pwn(42036) : fatal error 107: too many error messages on one line -
Si ce fac? Pun doar
#define SQL_HOST
#define SQL_USER
#define SQL_PASS
#define SQL_DB -
handle = mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
Daca pun la SQL_USER -> root imi da eroare
Daca las liber la SQL_PASS -> imi da eroare.
Ma puteti ajuta sa-l completez?
Folosesc xampp , la SQL_HOST am pus 127.0.0.1 si merge, dar la restu nu stiu ce sa pun
-
handle = mysql_connect(127.0.0.1, root, database, SQL_PASS);
La linia asta ce pun la SQL_PASS daca n-am parola?
-
la linia asta
handle = mysql_connect(127.0.0.1, root, database, SQL_PASS);
In loc de SQL_PASS ce pun daca n-am parola?
-
-
Acum 5 minute, KenZ0R12341 a spus:
mergi la dialoguri unde sunt definite si pui acolo un o noua definitie #define DIALOG_STYLE_TABLIST_HEADERS SI AICI PUI URMATORUL NR LA DIALOGURI. Vezi sa pui fix la sfarsitul dialogurilor dupa 148 sau 149 si iti va merge.
Ai sters pubic onplayersetdamage?
Mersi, merge dar acum cand deschid serverul imi apare consola acea in cmd, si imi da "loding mysql" si se blocheaza asa... Ma puteti ajuta?
-
Nu merge sa compilez imi da erorile astea:
SpoilerC:\Documents and Settings\Administrator\My Documents\og-times\gamemodes\gamemode.pwn(7244) : warning 209: function "fk_OnPlayerConnect" should return a value
C:\Documents and Settings\Administrator\My Documents\og-times\gamemodes\gamemode.pwn(11360) : error 017: undefined symbol "DIALOG_STYLE_TABLIST"
C:\Documents and Settings\Administrator\My Documents\og-times\gamemodes\gamemode.pwn(16860) : error 017: undefined symbol "DIALOG_STYLE_TABLIST"
C:\Documents and Settings\Administrator\My Documents\og-times\gamemodes\gamemode.pwn(16873) : error 017: undefined symbol "DIALOG_STYLE_TABLIST"
C:\Documents and Settings\Administrator\My Documents\og-times\gamemodes\gamemode.pwn(16886) : error 017: undefined symbol "DIALOG_STYLE_TABLIST"
C:\Documents and Settings\Administrator\My Documents\og-times\gamemodes\gamemode.pwn(18840) : error 017: undefined symbol "DIALOG_STYLE_TABLIST_HEADERS"
C:\Documents and Settings\Administrator\My Documents\og-times\gamemodes\gamemode.pwn(27326) : error 017: undefined symbol "DIALOG_STYLE_TABLIST_HEADERS"
C:\Documents and Settings\Administrator\My Documents\og-times\gamemodes\gamemode.pwn(31940) : error 017: undefined symbol "DIALOG_STYLE_TABLIST"
C:\Documents and Settings\Administrator\My Documents\og-times\gamemodes\gamemode.pwn(36323) : error 017: undefined symbol "DIALOG_STYLE_TABLIST_HEADERS"
C:\Documents and Settings\Administrator\My Documents\og-times\gamemodes\gamemode.pwn(38721) : error 017: undefined symbol "DIALOG_STYLE_TABLIST_HEADERS"
C:\Documents and Settings\Administrator\My Documents\og-times\gamemodes\gamemode.pwn(40769) : error 017: undefined symbol "DIALOG_STYLE_TABLIST"
C:\Documents and Settings\Administrator\My Documents\og-times\gamemodes\gamemode.pwn(43835) : warning 203: symbol is never used: "RandomMSG"Ma puteti ajuta? Am toate pluginurile , am mysql , am geoip , am include-urile
-
Salut, doresc sa ma ajute cineva cu comanda /arrest
vreau sa-mi schimbati comanda sa fie simpla de genu sa dau doar /arrest [playerid] nu complicata cum e ea.if(strcmp(cmd, "/arrest", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gTeam[playerid] == 2 || IsACop(playerid))
{
if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " You are not on Duty!");
return 1;
}
if(!PlayerToPoint(6.0, playerid, 1527.9849,-1664.6001,6.2188))// || PlayerToPoint(6.0, playerid, -1566.4946,755.7339,-4.9063))
{// Jail spot
SendClientMessage(playerid, COLOR_GREY, " You are not near the Jail, can't Arrest !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{66FFCC}Foloseste:{FFFFFF} /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
return 1;
}
moneys = strval(tmp);
if(moneys < 1 || moneys > 99999) { SendClientMessage(playerid, COLOR_GREY, " Jail Price can't be below $1 or above $99999 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{66FFCC}Foloseste:{FFFFFF} /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
return 1;
}
new time = strval(tmp);
if(time < 1 || time > 20) { SendClientMessage(playerid, COLOR_GREY, " Jail Time Minutes can't be below 1 or above 20 (Take the person to prison then) !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{66FFCC}Foloseste:{FFFFFF} /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
return 1;
}
new bail = strval(tmp);
if(bail < 0 || bail > 1) { SendClientMessage(playerid, COLOR_GREY, " Jail Bailing can't be below 0 or above 1 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{66FFCC}Foloseste:{FFFFFF} /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
return 1;
}
new bailprice = strval(tmp);
if(bailprice < 0 || bailprice > 3000000) { SendClientMessage(playerid, COLOR_GREY, " Jail Bailing can't be below $0 or above $3000000 !"); return 1; }
new suspect = GetClosestPlayer(playerid);
if(IsPlayerConnected(suspect))
{
if(GetDistanceBetweenPlayers(playerid,suspect) < 5)
{
GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerInfo[suspect][pWantedLevel] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " Player must be at least Wanted Level 1 !");
return 1;
}
format(string, sizeof(string), "* You arrested %s !", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GivePlayerMoney(suspect, -moneys);
format(string, sizeof(string), "arrested by %s ~n~ for $%d", sendername, moneys);
GameTextForPlayer(suspect, string, 5000, 5);
ResetPlayerWeapons(suspect);
if(PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pLeader]==1)
{
format(string, sizeof(string), "<< Officer %s arrested suspect %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
else if(PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pLeader]==2)
{
format(string, sizeof(string), "<< FBI Agent %s arrested suspect %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
else if(PlayerInfo[playerid][pMember]==3||PlayerInfo[playerid][pLeader]==3)
{
format(string, sizeof(string), "<< Soldier %s arrested suspect %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
SetPlayerInterior(suspect, 10);
SetPlayerPos(suspect,223.2281,114.4777,999.0156);
PlayerInfo[suspect][pJailTime] = time * 60;
if(bail == 1)
{
JailPrice[suspect] = bailprice;
format(string, sizeof(string), "You are jailed for %d seconds. Bail: $%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
}
else
{
JailPrice[suspect] = 0;
format(string, sizeof(string), "You are jailed for %d seconds. Bail: Unable", PlayerInfo[suspect][pJailTime]);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
}
PlayerInfo[suspect][pJailed] = 1;
PlayerInfo[suspect][pArrested] += 1;
SetPlayerFree(suspect,playerid, "Got Arrested");
TextDrawShowForPlayer(suspect, JailTD[suspect]);
WantedPoints[suspect] = 0;
WantedLevel[suspect] = 0;
WantLawyer[suspect] = 1;
}//distance
}//not connected
else
{
SendClientMessage(playerid, COLOR_GREY, " No-one close enough to arrest.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not a Cop / FBI / NG !");
return 1;
}
}//not connected
return 1;
} -
Salut, doresc sa ma ajute cineva cu comanda /arrest
vreau sa-mi schimbati comanda sa fie simpla de genu sa dau doar /arrest [playerid] nu complicata cum e ea.Spoilerif(strcmp(cmd, "/arrest", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gTeam[playerid] == 2 || IsACop(playerid))
{
if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " You are not on Duty!");
return 1;
}
if(!PlayerToPoint(6.0, playerid, 1527.9849,-1664.6001,6.2188))// || PlayerToPoint(6.0, playerid, -1566.4946,755.7339,-4.9063))
{// Jail spot
SendClientMessage(playerid, COLOR_GREY, " You are not near the Jail, can't Arrest !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{66FFCC}Foloseste:{FFFFFF} /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
return 1;
}
moneys = strval(tmp);
if(moneys < 1 || moneys > 99999) { SendClientMessage(playerid, COLOR_GREY, " Jail Price can't be below $1 or above $99999 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{66FFCC}Foloseste:{FFFFFF} /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
return 1;
}
new time = strval(tmp);
if(time < 1 || time > 20) { SendClientMessage(playerid, COLOR_GREY, " Jail Time Minutes can't be below 1 or above 20 (Take the person to prison then) !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{66FFCC}Foloseste:{FFFFFF} /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
return 1;
}
new bail = strval(tmp);
if(bail < 0 || bail > 1) { SendClientMessage(playerid, COLOR_GREY, " Jail Bailing can't be below 0 or above 1 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{66FFCC}Foloseste:{FFFFFF} /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
return 1;
}
new bailprice = strval(tmp);
if(bailprice < 0 || bailprice > 3000000) { SendClientMessage(playerid, COLOR_GREY, " Jail Bailing can't be below $0 or above $3000000 !"); return 1; }
new suspect = GetClosestPlayer(playerid);
if(IsPlayerConnected(suspect))
{
if(GetDistanceBetweenPlayers(playerid,suspect) < 5)
{
GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerInfo[suspect][pWantedLevel] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " Player must be at least Wanted Level 1 !");
return 1;
}
format(string, sizeof(string), "* You arrested %s !", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GivePlayerMoney(suspect, -moneys);
format(string, sizeof(string), "arrested by %s ~n~ for $%d", sendername, moneys);
GameTextForPlayer(suspect, string, 5000, 5);
ResetPlayerWeapons(suspect);
if(PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pLeader]==1)
{
format(string, sizeof(string), "<< Officer %s arrested suspect %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
else if(PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pLeader]==2)
{
format(string, sizeof(string), "<< FBI Agent %s arrested suspect %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
else if(PlayerInfo[playerid][pMember]==3||PlayerInfo[playerid][pLeader]==3)
{
format(string, sizeof(string), "<< Soldier %s arrested suspect %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
SetPlayerInterior(suspect, 10);
SetPlayerPos(suspect,223.2281,114.4777,999.0156);
PlayerInfo[suspect][pJailTime] = time * 60;
if(bail == 1)
{
JailPrice[suspect] = bailprice;
format(string, sizeof(string), "You are jailed for %d seconds. Bail: $%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
}
else
{
JailPrice[suspect] = 0;
format(string, sizeof(string), "You are jailed for %d seconds. Bail: Unable", PlayerInfo[suspect][pJailTime]);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
}
PlayerInfo[suspect][pJailed] = 1;
PlayerInfo[suspect][pArrested] += 1;
SetPlayerFree(suspect,playerid, "Got Arrested");
TextDrawShowForPlayer(suspect, JailTD[suspect]);
WantedPoints[suspect] = 0;
WantedLevel[suspect] = 0;
WantLawyer[suspect] = 1;
}//distance
}//not connected
else
{
SendClientMessage(playerid, COLOR_GREY, " No-one close enough to arrest.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not a Cop / FBI / NG !");
return 1;
}
}//not connected
return 1;
} -
Rezolvat.
Ajutor Comanda
in Discuţii scripting
Posted
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.