Serafim
-
Posts
25 -
Joined
-
Last visited
Content Type
Profiles
Forums
News
Documentation
Posts posted by Serafim
-
-
Sincer , din experienta mea(una de mediu) am inceput cu editul, ii faceam edit la GM GodFather, ii adaugam comenzi , ii adaugam tot felu de scripturi de pe internet , ii rezolvam erorile , pt ca odata bagata o comanda noua din alt GM, nu putea fi identica , si ca sa pot rezolva , ma uitam la celelalte comenzi si vedeam unde difera, apoi cu putin cate putin din tutoriale, din curiozitate , din paiune m-am interesat ce fac anumite linii si tot asa
Cam asa merg si eu, iti propun sa faci cum a zis si
WiDuAlK.SaMp -
Am rezolvat, nu mai da wanted. Dar.. imi scrie ca am comis o crima, crima mea a fost raportata dar wanted nu am, si nu apar pe /wanted. Dar ma enerveaza ca scrie ca am comis o crima, m-ar putea ajuta cineva sa o sterg?
-
Acceasi problema, tot se pune wanted cand il omor
[pawn] if(PlayerData[killerid][pMember] != 1 || PlayerData[killerid][pLeader] != 1 || PlayerData[killerid][pMember] != 2 || PlayerData[killerid][pLeader] != 2 || PlayerData[killerid][pMember] != 3 || PlayerData[killerid][pLeader] != 3)[/pawn]
-
Am modificat si tot asa imi da
if(PlayerData[killerid][pMember] != 1)
P.S: Am PlayerData nu PlayerInfo
-
[pawn]if(victimteam >= 4)
{
if(IsPlayerConnected(killerid))
{
new slice = 100; //100$
playercash = GetPlayerCash(playerid);
if(gTeam[killerid] != 2)
{
WantedPoints[killerid] += 2;
PlayerData[killerid][pWantedPoints] = WantedPoints[killerid];
format(string, sizeof(string), "UPDATE players SET WantedPoints='%d' WHERE id=%d", PlayerData[killerid][pWantedPoints], PlayerData[killerid][pSQLID]);
mysql_query(string);
}
if(SafeTime[playerid] <= 0)
{
if(gTeam[killerid] != gTeam[playerid])
{
if(GetPlayerState(killerid) == 1)
{
PlayerData[killerid][pKills] = PlayerData[killerid][pKills] + 2;
}
else
{
PlayerData[killerid][pKills]++;
}
PlayerData[playerid][pKills]--;
format(string, sizeof(string), "UPDATE players SET Kills='%d' WHERE id=%d", PlayerData[playerid][pKills], PlayerData[playerid][pSQLID]);
mysql_query(string);
format(string, sizeof(string), "UPDATE players SET Kills='%d' WHERE id=%d", PlayerData[killerid][pKills], PlayerData[killerid][pSQLID]);
mysql_query(string);
}
}
if (((gTeam[killerid]) == 1) || ((gTeam[killerid]) == 3 && civnokill) || (gTeam[killerid] == gTeam[playerid] && gTeam[playerid] != 4))
{
slice = 0;
}
if (((gTeam[killerid]) != 4) && ((gTeam[killerid]) == gTeam[playerid]))//no team kill
{
slice = 0;
}
if (playercash > 0)
{
//GivePlayerCash(playerid, -slice);
}
else
{
slice = slice+500;
}
PlayerPlaySound(killerid, 1083, 0.0, 0.0, 0.0);
if (((gTeam[killerid]) == 3) && reason != 49)
{
SetPlayerCriminal(killerid,255, "Omor Calificat");
}
else if (((gTeam[killerid]) == 3) && reason == 49)
{
SetPlayerCriminal(killerid,255, "Lovit si fugit");
}
}
}
else if (victimteam == 2)
{
if(IsPlayerConnected(killerid))
{
PlayerData[playerid][pKills]--;
format(string, sizeof(string), "UPDATE players SET Kills='%d' WHERE id=%d", PlayerData[playerid][pKills], PlayerData[playerid][pSQLID]);
mysql_query(string);
if (gTeam[killerid] == 2)//cops kill cop
{
PlayerPlaySound(killerid, 1084, 0.0, 0.0, 0.0);
GivePlayerCash(killerid, -suecost);
GivePlayerCash(playerid, suecost+100);//+100pays hospital bill
}
if (gTeam[killerid] >= 3)
{
WantedPoints[killerid] += 2; //+ 2 wanted points
PlayerData[killerid][pWantedPoints] = WantedPoints[killerid];
format(string, sizeof(string), "UPDATE players SET WantedPoints='%d' WHERE id=%d", PlayerData[killerid][pWantedPoints], PlayerData[killerid][pSQLID]);
mysql_query(string);
if(reason != 49)
{
SetPlayerCriminal(killerid,255, "Omor Calificat");
}
else if (reason == 49)
{
SetPlayerCriminal(killerid,255, "Lovit si fugit");
}
}
if(gTeam[killerid] >= 5 && SafeTime[playerid] <= 0)
{
if(GetPlayerState(killerid) == 1)
{
PlayerData[killerid][pKills] = PlayerData[killerid][pKills]+2;
}
else
{
PlayerData[killerid][pKills]++;
}
WantedPoints[killerid]+=2;
PlayerData[killerid][pWantedPoints] = WantedPoints[killerid];
format(string, sizeof(string), "UPDATE players SET WantedPoints='%d' WHERE id=%d", PlayerData[killerid][pWantedPoints], PlayerData[killerid][pSQLID]);
mysql_query(string);
format(string, sizeof(string), "UPDATE players SET Kills='%d' WHERE id=%d", PlayerData[killerid][pKills], PlayerData[killerid][pSQLID]);
mysql_query(string);
}
}
}
else if (victimteam == 3)
{
if(IsPlayerConnected(killerid))
{
if ((gTeam[killerid]) == 2)//cops kill civ
{
if(WantedLevel[playerid] < 1)
{
PlayerPlaySound(killerid, 1084, 0.0, 0.0, 0.0);
GivePlayerCash(killerid, -suecost);
GivePlayerCash(playerid, suecost+10);//+100pays hospital bill
}
}
else
{
WantedPoints[killerid] += 2;
PlayerData[killerid][pWantedPoints] = WantedPoints[killerid];
format(string, sizeof(string), "UPDATE players SET WantedPoints='%d' WHERE id=%d", PlayerData[killerid][pWantedPoints], PlayerData[killerid][pSQLID]);
mysql_query(string);
}
if (((gTeam[killerid]) >= 3 || (gTeam[killerid]) == 1) && reason != 49)
{
SetPlayerCriminal(killerid,255, "Omor Calificat");
}
else if (((gTeam[killerid]) >= 3 || (gTeam[killerid]) == 1) && reason == 49)
{
SetPlayerCriminal(killerid,255, "Lovit si fugit");
}
}
}
else if (victimteam == 1)
{
if(IsPlayerConnected(killerid))
{
if ((gTeam[killerid]) == 2)//cops kill civ
{
PlayerPlaySound(killerid, 1084, 0.0, 0.0, 0.0);
GivePlayerCash(killerid, -suecost);
GivePlayerCash(playerid, suecost+10);//+100pays hospital bill
}
else if ((gTeam[killerid]) == 1)//med kill civ
{
PlayerPlaySound(killerid, 1084, 0.0, 0.0, 0.0);
GivePlayerCash(killerid, -suecost);
GivePlayerCash(playerid, suecost+10);//+100pays hospital bill
}
if (((gTeam[killerid]) == 4) && reason != 49)
{
SetPlayerCriminal(killerid,255, "Omor calificat");
}
else if (((gTeam[killerid]) == 3) && reason == 49)
{
SetPlayerCriminal(killerid,255, "Lovit si fugit");
}
}
}[/pawn] -
EDIT:
[pawn]if(victimteam >= 4)
{
if(IsPlayerConnected(killerid))
{
new slice = 100; //100$
playercash = GetPlayerCash(playerid);
if(gTeam[killerid] != 2)
{
WantedPoints[killerid] += 2;
PlayerData[killerid][pWantedPoints] = WantedPoints[killerid];
format(string, sizeof(string), "UPDATE players SET WantedPoints='%d' WHERE id=%d", PlayerData[killerid][pWantedPoints], PlayerData[killerid][pSQLID]);
mysql_query(string);
}
if(SafeTime[playerid] <= 0)
{
if(gTeam[killerid] != gTeam[playerid])
{
if(GetPlayerState(killerid) == 1)
{
PlayerData[killerid][pKills] = PlayerData[killerid][pKills] + 2;
}
else
{
PlayerData[killerid][pKills]++;
}
PlayerData[playerid][pKills]--;
format(string, sizeof(string), "UPDATE players SET Kills='%d' WHERE id=%d", PlayerData[playerid][pKills], PlayerData[playerid][pSQLID]);
mysql_query(string);
format(string, sizeof(string), "UPDATE players SET Kills='%d' WHERE id=%d", PlayerData[killerid][pKills], PlayerData[killerid][pSQLID]);
mysql_query(string);
}
}
if (((gTeam[killerid]) == 1) || ((gTeam[killerid]) == 3 && civnokill) || (gTeam[killerid] == gTeam[playerid] && gTeam[playerid] != 4))
{
slice = 0;
}
if (((gTeam[killerid]) != 4) && ((gTeam[killerid]) == gTeam[playerid]))//no team kill
{
slice = 0;
}
if (playercash > 0)
{
//GivePlayerCash(playerid, -slice);
}
else
{
slice = slice+500;
}
PlayerPlaySound(killerid, 1083, 0.0, 0.0, 0.0);
if (((gTeam[killerid]) == 3) && reason != 49)
{
SetPlayerCriminal(killerid,255, "Omor Calificat");
}
else if (((gTeam[killerid]) == 3) && reason == 49)
{
SetPlayerCriminal(killerid,255, "Lovit si fugit");
}
}
}
else if (victimteam == 2)
{
if(IsPlayerConnected(killerid))
{
PlayerData[playerid][pKills]--;
format(string, sizeof(string), "UPDATE players SET Kills='%d' WHERE id=%d", PlayerData[playerid][pKills], PlayerData[playerid][pSQLID]);
mysql_query(string);
if (gTeam[killerid] == 2)//cops kill cop
{
PlayerPlaySound(killerid, 1084, 0.0, 0.0, 0.0);
GivePlayerCash(killerid, -suecost);
GivePlayerCash(playerid, suecost+100);//+100pays hospital bill
}
if (gTeam[killerid] >= 3)
{
WantedPoints[killerid] += 2; //+ 2 wanted points
PlayerData[killerid][pWantedPoints] = WantedPoints[killerid];
format(string, sizeof(string), "UPDATE players SET WantedPoints='%d' WHERE id=%d", PlayerData[killerid][pWantedPoints], PlayerData[killerid][pSQLID]);
mysql_query(string);
if(reason != 49)
{
SetPlayerCriminal(killerid,255, "Omor Calificat");
}
else if (reason == 49)
{
SetPlayerCriminal(killerid,255, "Lovit si fugit");
}
}
if(gTeam[killerid] >= 5 && SafeTime[playerid] <= 0)
{
if(GetPlayerState(killerid) == 1)
{
PlayerData[killerid][pKills] = PlayerData[killerid][pKills]+2;
}
else
{
PlayerData[killerid][pKills]++;
}
WantedPoints[killerid]+=2;
PlayerData[killerid][pWantedPoints] = WantedPoints[killerid];
format(string, sizeof(string), "UPDATE players SET WantedPoints='%d' WHERE id=%d", PlayerData[killerid][pWantedPoints], PlayerData[killerid][pSQLID]);
mysql_query(string);
format(string, sizeof(string), "UPDATE players SET Kills='%d' WHERE id=%d", PlayerData[killerid][pKills], PlayerData[killerid][pSQLID]);
mysql_query(string);
}
}
}
else if (victimteam == 3)
{
if(IsPlayerConnected(killerid))
{
if ((gTeam[killerid]) == 2)//cops kill civ
{
if(WantedLevel[playerid] < 1)
{
PlayerPlaySound(killerid, 1084, 0.0, 0.0, 0.0);
GivePlayerCash(killerid, -suecost);
GivePlayerCash(playerid, suecost+10);//+100pays hospital bill
}
}
else
{
WantedPoints[killerid] += 2;
PlayerData[killerid][pWantedPoints] = WantedPoints[killerid];
format(string, sizeof(string), "UPDATE players SET WantedPoints='%d' WHERE id=%d", PlayerData[killerid][pWantedPoints], PlayerData[killerid][pSQLID]);
mysql_query(string);
}
if (((gTeam[killerid]) >= 3 || (gTeam[killerid]) == 1) && reason != 49)
{
SetPlayerCriminal(killerid,255, "Omor Calificat");
}
else if (((gTeam[killerid]) >= 3 || (gTeam[killerid]) == 1) && reason == 49)
{
SetPlayerCriminal(killerid,255, "Lovit si fugit");
}
}
}
else if (victimteam == 1)
{
if(IsPlayerConnected(killerid))
{
if ((gTeam[killerid]) == 2)//cops kill civ
{
PlayerPlaySound(killerid, 1084, 0.0, 0.0, 0.0);
GivePlayerCash(killerid, -suecost);
GivePlayerCash(playerid, suecost+10);//+100pays hospital bill
}
else if ((gTeam[killerid]) == 1)//med kill civ
{
PlayerPlaySound(killerid, 1084, 0.0, 0.0, 0.0);
GivePlayerCash(killerid, -suecost);
GivePlayerCash(playerid, suecost+10);//+100pays hospital bill
}
if (((gTeam[killerid]) == 4) && reason != 49)
{
SetPlayerCriminal(killerid,255, "Omor calificat");
}
else if (((gTeam[killerid]) == 3) && reason == 49)
{
SetPlayerCriminal(killerid,255, "Lovit si fugit");
}
}
}[/pawn] -
Problemă întâlnită (descriere): Cand un politist omoara un civil, sau pe cineva cu wanted, ii da si politistului wanted.
Ero(area / rile) / warning-(ul / urile):
Liniile de cod / sursa / script-ul:
Imagini / Video (optional):
Aţi încercat să rezolvaţi singur?: Din pacate nu, folosesc R-GM RPG. -
Comanda am pus-o la sfarsitul gamemode-ului
-
Problemă întâlnită (descriere): Am incercat sa fac dupa tutorialul lui Maurice, comanda /arrest sa nu mai scriu eu/politistul /arrest cautiune, pret cautiune, timp si etc. Sa se bage automat
Ero(area / rile) / warning-(ul / urile): [pawn]C:UsersMihaiDesktoptestR-GM.pwn(64060) : warning 203: symbol is never used: "arrest"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
Header size: 12624 bytes
Code size: 2955292 bytes
Data size: 19846624 bytes
Stack/heap size: 16384 bytes; estimated max. usage: unknown, due to recursion
Total requirements:22830924 bytes
1 Warning.
[/pawn]
Liniile de cod / sursa / script-ul: http://pastebin.com/4Mr0fBJn
Imagini / Video (optional): --
Aţi încercat să rezolvaţi singur?: Am incercat sa modific de la linia "64058" care scrie :[pawn]CMD:arrest(playerid, params[])[/pawn] stiu ca eroarea e la " 64060" dar la linia aia scrie [pawn] new id,amount,time,bail,bailp,string[128],sendername[25],giveplayer[25];[/pawn]Am editat in "arrested" si tot eroarea aia imi dadea doar ca "arrested" la sfarsit.
-
Problemă întâlnită (descriere): /arrest
Ero(area / rile) / warning-(ul / urile): As vrea ca atunci cand membrul/liderul PD, S.R.I, Armata sa nu mai scrie /arrest id pret, timp , cautiune , pret cautiune. Sa setez eu din gamemode, sa se dea automat de exemplu :Wanted 1: /arrest 2000 10 1 10000
Wanted 2: /arrest 3000 12 1 20000
Wanted 3: /arrest 5000 14 1 30000
Wanted 4: /arrest 7000 16 1 40000
Wanted 5: /arrest 8000 18 1 50000
Wanted 6: /arrest 9000 20 1 60000
Liniile de cod / sursa / script-ul: http://pastebin.com/LY9YTB13
Imagini / Video (optional): --
Aţi încercat să rezolvaţi singur?: Nu stiu ce sa modific. -
Da, am schimbat-o si acum merge. M-a ajuta Vanilla ! Asta a zis si el.
-
E cam complicat pentru mine, puteti da t/c
-
Problemă întâlnită (descriere): Comanda /clear [ imi zice Nu esti politist]
Ero(area / rile) / warning-(ul / urile): --
Liniile de cod / sursa / script-ul: [pawn] if(strcmp(cmd, "/clear", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gTeam[playerid] == 2)
{
if (!PlayerToPoint(3.0, playerid, 253.9280,69.6094,1003.6406))
{
SendClientMessage(playerid, COLOR_GRAD2, "Nu esti la sediul politiei!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendUsage(playerid,"{1fab48}» Foloseste: {FFFFFF}/clear [playerid/PartOfName][reason]");
return 1;
}
giveplayerid = ReturnUser(tmp);
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[200];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
for(new s = 0; s < num_words; s++)
{
new pos;
while((pos = strfind(result,Swears,true)) != -1) for(new i = pos, j = pos + strlen(Swears); i < j; i++)
{
result = '*';
}
}
if(!strlen(result))
{
SendUsage(playerid,"{1fab48}» Foloseste: {FFFFFF}/clear [playerid/PartOfName][reason]");
return 1;
}
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "Nu poti sa iti stergi singur stelele!"); return 1; }
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* Politistul %s ti-a sters wanted-ul, motiv: %s.", sendername,result);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s i-a sters la %s wanted-ul, motiv: %s.", sendername, giveplayer, result);
SendRadioMessage(1, TEAM_BLUE_COLOR, string);
SendRadioMessage(2, TEAM_BLUE_COLOR, string);
SendRadioMessage(3, TEAM_BLUE_COLOR, string);
WantedPoints[giveplayerid] = 0;
WantedLevel[giveplayerid] = 0;
ClearCrime(giveplayerid);
SetPlayerWantedLevel(giveplayerid, 0);
PlayerData[giveplayerid][pWantedPoints] = WantedPoints[giveplayerid];
format(string, sizeof(string), "UPDATE players SET WantedPoints='%d' WHERE id=%d", PlayerData[giveplayerid][pWantedPoints], PlayerData[giveplayerid][pSQLID]);
mysql_query(string);
format(string, sizeof(string), "UPDATE players SET WantedLevel='%d' WHERE id=%d", WantedLevel[giveplayerid], PlayerData[giveplayerid][pSQLID]);
mysql_query(string);
if(gTeam[giveplayerid] == 4)
{
gTeam[giveplayerid] = 3;
SetPlayerToTeamColor(giveplayerid);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Acest jucator nu este conectat!");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Nu esti politist!");
}
}
return 1;
}[/pawn]
Sau http://pastebin.com/mfFBsNHZ
Imagini / Video (optional):
Aţi încercat să rezolvaţi singur?: Sa schimb comanda, doar.
-
Da, ok, schimb coordonatele. dar masinile?
-
Problemă întâlnită (descriere): HQ-urile sunt in toate orasele [LS, LV, SF], ceea ce nu e bine, fiindca jucatorii o sa fie in orase diferite, politia si smurd-ul, alte factiuni dureaza sa ajunga la respectivul, si asa as vrea sa mut toate hq-urile din LV, SF in LS. Asa, orasul LS va fi mai popular, vreau sa-mi deschid server, si stiu ca nu o sa fie foarte departe, dar o sa fie greu, daca factiunile sunt in orase diferite. Cine imi poate zice cum sa le mut?
Ero(area / rile) / warning-(ul / urile): --
Liniile de cod / sursa / script-ul: --
Imagini / Video (optional): --
Aţi încercat să rezolvaţi singur?: Nu, fiindca nu stiu. -
T/C Gamemode-ul parea fain, dar are multe buguri!
-
Problemă întâlnită (descriere): Daca dau /v sellto imi apare mesajul asta http://i.imgur.com/90DdIi0.png : ok, dar... multi jucatori pot lua teapa, si asa ca... as vrea o comanda functionala de /v sellto care sa mearga, fara buguri. Stiu ca cer totul pe farfurie, imi pare rau... dar am incercat sa fac comanda singur, sa iau din alt gamemode, si nu am gasit, nu am facut bine. Asa ca v-as ruga... sa-mi dati voi una, sau sa o reparati pe a mea.
Ero(area / rile) / warning-(ul / urile): http://i.imgur.com/90DdIi0.png
Liniile de cod / sursa / script-ul: [pawn] SendUsage(playerid,"/v sellto [playerid/PartOfName] [pret]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(ProxDetectorS(8.0, playerid, giveplayerid))
{
if(PlayerData[giveplayerid][pPcarkey] == 999)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "HINT: /v sellto [playerid/PartOfName] [pret]");
return 1;
}
new price;
price = strval(tmp);
if(price < 1 || price > 1500000)
{
SendClientMessage(playerid, COLOR_GREY, " Pretul trebuie sa fie de la 1$ pana la 1500000$. ");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* I-ai oferit lui %s masina ta pentru $%d .", giveplayer, price);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* Propietarul masinii %s ti-a oferit masina pentru $%d (scrie /accept ownablecar) s-o cumperi.", playername, price);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
OwnableCarID[giveplayerid] = ownvehkey;
OwnableCarOffer[giveplayerid] = playerid;
OwnableCarPrice[giveplayerid] = price;
return 1;
}
else if(PlayerData[giveplayerid][pPcarkey2] == 999)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "HINT: /v sellto [playerid/PartOfName] [pret]");
return 1;
}
new price;
price = strval(tmp);
if(price < 1 || price > 1500000)
{
SendClientMessage(playerid, COLOR_GREY, " Pretul trebuie sa fie de la 1$ pana la 1500000$. ");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* I-ai oferit lui %s masina ta pentru $%d .", giveplayer, price);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* Propietarul masinii %s ti-a oferit masina pentru $%d (scrie /accept ownablecar) s-o cumperi.", playername, price);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
OwnableCarOffer[giveplayerid] = playerid;
OwnableCarID[giveplayerid] = ownvehkey;
OwnableCarPrice[giveplayerid] = price;
return 1;
}
else if(PlayerData[giveplayerid][pPcarkey3] == 999)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "HINT: /v sellto [playerid/PartOfName] [pret]");
return 1;
}
new price;
price = strval(tmp);
if(price < 1 || price > 1500000)
{
SendClientMessage(playerid, COLOR_GREY, " Pretul trebuie sa fie de la 1$ pana la 1500000$. ");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* I-ai oferit lui %s masina ta pentru $%d .", giveplayer, price);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* Propietarul masinii %s ti-a oferit masina pentru $%d (scrie /accept ownablecar) s-o cumperi.", playername, price);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
OwnableCarOffer[giveplayerid] = playerid;
OwnableCarID[giveplayerid] = ownvehkey;
OwnableCarPrice[giveplayerid] = price;
return 1;
}
if(PlayerData[giveplayerid][pPcarkey4] == 999)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "HINT: /v sellto [playerid/PartOfName] [pret]");
return 1;
}
new price;
price = strval(tmp);
if(price < 1 || price > 1500000)
{
SendClientMessage(playerid, COLOR_GREY, " Pretul trebuie sa fie de la 1$ pana la 1500000$. ");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* I-ai oferit lui %s masina ta pentru $%d .", giveplayer, price);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* Propietarul masinii %s ti-a oferit masina pentru $%d (scrie /accept ownablecar) s-o cumperi.", playername, price);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
OwnableCarOffer[giveplayerid] = playerid;
OwnableCarID[giveplayerid] = ownvehkey;
OwnableCarPrice[giveplayerid] = price;
return 1;
}
if(PlayerData[giveplayerid][pPcarkey5] == 999)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "HINT: /v sellto [playerid/PartOfName] [pret]");
return 1;
}
new price;
price = strval(tmp);
if(price < 1 || price > 1500000)
{
SendClientMessage(playerid, COLOR_GREY, " Pretul trebuie sa fie de la 1$ pana la 1500000$. ");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* I-ai oferit lui %s masina ta pentru $%d .", giveplayer, price);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* Propietarul masinii %s ti-a oferit masina pentru $%d (scrie /accept ownablecar) s-o cumperi.", playername, price);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
OwnableCarOffer[giveplayerid] = playerid;
OwnableCarID[giveplayerid] = ownvehkey;
OwnableCarPrice[giveplayerid] = price;
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Playerul are deja 5 masini !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Acest jucator nu este langa tine!");
return 1;
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Nu este masina ta ");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Trebuie sa fi in masina ca sa o vinzi!");
return 1;
}
}
return 1;
}[/pawn]
Imagini / Video (optional): http://i.imgur.com/90DdIi0.png
Aţi încercat să rezolvaţi singur?: Da..P.S: E Gamemode, nu am lucrat la nume, una alta. doar la comenzi mai mult, si la test.
-
Posteaza comanda /v buy (sau care o ai tu pentru cumparat masini)
[pawn] if(strcmp(cmd, "/cumparmasina", true) == 0)
{
new newcar = GetPlayerVehicleID(playerid);
if(CarData[newcar-PreVehicle][cOwned] == 1 && newcar > PreVehicle)
{
return 1;
}
/*if(PlayerData[playerid][pDonateRank] != 3 && IsADonatorCar(newcar))
{
SendClientMessage(playerid, COLOR_GREY, "Nu poti cumpara masina asta deoarece este un infernus/bullet/turismo si nu ai donator de aur!");
return 1;
}*/
if(PlayerData[playerid][pCash] >= CarData[newcar - PreVehicle][cValue])
{
if(PlayerData[playerid][pPcarkey] == 999 && !IsABike(newcar) && !IsAPlane(newcar) && !IsABoat(newcar))
{
PlayerData[playerid][pPcarkey] = newcar - PreVehicle;
TogglePlayerControllable(playerid, 0);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"* Felicitari! Ti-ai cumparat o masina personala");
GivePlayerCash(playerid, - CarData[newcar - PreVehicle][cValue]);
CarData[newcar-PreVehicle][cOwned] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(CarData[newcar-PreVehicle][cOwner], sendername, 0, strlen(sendername), 999);
TogglePlayerControllable(playerid, 1);
new query[MAX_STRING];
format(query, sizeof(query), "UPDATE cars SET Owned='%d' WHERE id=%d", CarData[newcar-PreVehicle][cOwned], newcar-PreVehicle);
mysql_query(query);
format(query, sizeof(query), "UPDATE cars SET Owner='%s' WHERE id=%d", CarData[newcar-PreVehicle][cOwner], newcar-PreVehicle);
mysql_query(query);
format(query, sizeof(query), "UPDATE players SET Car='%d' WHERE id=%d", PlayerData[playerid][pPcarkey], PlayerData[playerid][pSQLID]);
mysql_query(query);
new year,month,day,hour,minute,second;
getdate(year, month, day);
gettime(hour,minute,second);
format(query, sizeof(query), "AdmCmd: %s a cumparmasina id %d in %d/%d/%d ora %d-%d-%d",PlayerData[playerid][pNume],newcar-PreVehicle,month,day,year,hour,minute,second);
PropertyLog(query);
return 1;
}
if(PlayerData[playerid][pPcarkey2] == 999 && IsABike(newcar) && !IsAPlane(newcar) && !IsABoat(newcar))
{
PlayerData[playerid][pPcarkey2] = newcar - PreVehicle;
TogglePlayerControllable(playerid, 0);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"* Felicitari! Ti-ai cumparat o motocicleta personala");
GivePlayerCash(playerid, - CarData[newcar - PreVehicle][cValue]);
CarData[newcar-PreVehicle][cOwned] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(CarData[newcar-PreVehicle][cOwner], sendername, 0, strlen(sendername), 999);
TogglePlayerControllable(playerid, 1);
new query[MAX_STRING];
format(query, sizeof(query), "UPDATE cars SET Owned='%d' WHERE id=%d", CarData[newcar-PreVehicle][cOwned], newcar-PreVehicle);
mysql_query(query);
format(query, sizeof(query), "UPDATE cars SET Owner='%s' WHERE id=%d", CarData[newcar-PreVehicle][cOwner], newcar-PreVehicle);
mysql_query(query);
format(query, sizeof(query), "UPDATE players SET Car2='%d' WHERE id=%d", PlayerData[playerid][pPcarkey2], PlayerData[playerid][pSQLID]);
mysql_query(query);
new year,month,day,hour,minute,second;
getdate(year, month, day);
gettime(hour,minute,second);
format(query, sizeof(query), "AdmCmd: %s a cumparmasina (moto) id %d in %d/%d/%d ora %d-%d-%d",PlayerData[playerid][pNume],newcar-PreVehicle,month,day,year,hour,minute,second);
PropertyLog(query);
return 1;
}
if(PlayerData[playerid][pPcarkey3] == 999 && !IsABike(newcar) && (IsAPlane(newcar) || IsABoat(newcar)))
{
PlayerData[playerid][pPcarkey3] = newcar - PreVehicle;
TogglePlayerControllable(playerid, 0);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"* Felicitari! Ti-ai cumparat o barca/ un avion personal(a)");
GivePlayerCash(playerid, - CarData[newcar - PreVehicle][cValue]);
CarData[newcar-PreVehicle][cOwned] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(CarData[newcar-PreVehicle][cOwner], sendername, 0, strlen(sendername), 999);
TogglePlayerControllable(playerid, 1);
new query[MAX_STRING];
format(query, sizeof(query), "UPDATE cars SET Owned='%d' WHERE id=%d", CarData[newcar-PreVehicle][cOwned], newcar-PreVehicle);
mysql_query(query);
format(query, sizeof(query), "UPDATE cars SET Owner='%s' WHERE id=%d", CarData[newcar-PreVehicle][cOwner], newcar-PreVehicle);
mysql_query(query);
format(query, sizeof(query), "UPDATE players SET Car3='%d' WHERE id=%d", PlayerData[playerid][pPcarkey3], PlayerData[playerid][pSQLID]);
mysql_query(query);
new year,month,day,hour,minute,second;
getdate(year, month, day);
gettime(hour,minute,second);
format(query, sizeof(query), "AdmCmd: %s a cumparmasina (avion/barca) id %d in %d/%d/%d ora %d-%d-%d",PlayerData[playerid][pNume],newcar-PreVehicle,month,day,year,hour,minute,second);
PropertyLog(query);
return 1;
}
else
{
SendClientMessage(playerid,COLOR_LIGHTRED,"* Deti deja o masina personala.");
return 1;
}
}
else
{
SendClientMessage(playerid,COLOR_LIGHTRED,"* Nu ai bani destui pentru a cumpara aceasta masina.");
}
return 1;
}[/pawn]
P.S:Daca scriu comanda scrie :
/cumparmasina imi zice: SERVER: Command Unknown.
Daca scriu orice alta comanda imi zice : Eroare:Aceasta comanda nu exista.Foloseste /help pentru o lista completa cu comenzile existente.
-
Am facut o comanda /gotods, tot acolo ma da, dar nu merge nici o comanda de cumparat masini.
Ce sa fac?
-
Asa m-a teleportat in MTA, nu am gasit nici o masina, si daca sunt in-game, nu e nimic.
-
Gireada, am cautat. [pawn]public IsAtDealership(playerid)
{
if(IsPlayerConnected(playerid))
{
if(PlayerToPoint(25.0,playerid,2128.0864,-1135.3912,25.5855) || PlayerToPoint(50,playerid,537.3366,-1293.2140,17.2422) || PlayerToPoint(35,playerid,2521.5544,-1524.4504,23.8365) || PlayerToPoint(50,playerid,2155.0146,-1177.3333,23.8211) || PlayerToPoint(50,playerid,299.1723,-1518.6627,24.6007))
{
return 1;
}
}
return 0;
}[/pawn]Cum pot sa-l gasesc acum?
-
M-a ajutat cineva de pe alt forum, am dat toate masinile la Dealership, insa problema e ca.... nu gasesc dealership, casele, biz, le-am vandut la stat, toate. Si acum astept sa gasesc dealership/sa fac rost de unul
-
Salut !Systemul meu ruleaza pe MYSQL, dar, nu stiu cum sa fac acel update query..Ti-am trimis in P.M adresa mea de skype, si mess. Daca vrei, ma poti ajuta
-
Problemă întâlnită (descriere): Am luat gamemod-ul rGaming v2.0 si sunt toate masinile, biz-urile, casele luate, si as vrea sa le dau pe toate deodata la stat sau ceva de genul asta. Fara sa modific pe fiecare Owned 0 si sa fie The State.As vrea sa dau wipe la bunuri
Ero(area / rile) / warning-(ul / urile): ---
Liniile de cod / sursa / script-ul:---
Imagini / Video (optional):---
Aţi încercat să rezolvaţi singur?:Nu, pentru ca nu ma pricep ..
Cand Dau G/f La Masina De Politie Imi Da Wanted
in Arhivă probleme
Posted
Problemă întâlnită (descriere): Cand dau G/F la masina de Politie imi da wanted
Ero(area / rile) / warning-(ul / urile): Cereti ce sa va dau.
Liniile de cod / sursa / script-ul:
Imagini / Video (optional):
Aţi încercat să rezolvaţi singur?: Nu, nu stiu ce trebuie editat.