Jump to content
  • 0

/v sellto


8ball

Question

Problema intalnita (descriere): Am o problema cu /v sellto, cand dau o masina cu /v sellto unui player merge....dar cand dau /stats  id-ul masini ramane la stats asi dori sa ma ajute cineva cu problema mea multumesc 

Ero(area / rile) / warning-(ul / urile):

Liniile de cod / sursa / script-ulelse if(strcmp(x_nr,"sellto",true) == 0)

{
if(IsPlayerConnected(playerid))
 {
if(GetPlayerVehicleID(playerid) == PlayerData[playerid][pPcarkey]+PreVehicle || GetPlayerVehicleID(playerid) == PlayerData[playerid][pPcarkey2]+PreVehicle || GetPlayerVehicleID(playerid) == PlayerData[playerid][pPcarkey3]+PreVehicle || GetPlayerVehicleID(playerid) == PlayerData[playerid][pPcarkey4]+PreVehicle || GetPlayerVehicleID(playerid) == PlayerData[playerid][pPcarkey5]+PreVehicle)
{
 GetPlayerName(playerid, playername, sizeof(sendername));
 new ownvehkey;
 if(GetPlayerVehicleID(playerid) == PlayerData[playerid][pPcarkey]+PreVehicle) { ownvehkey = PlayerData[playerid][pPcarkey]; }
else if(GetPlayerVehicleID(playerid) == PlayerData[playerid][pPcarkey2]+PreVehicle) { ownvehkey = PlayerData[playerid][pPcarkey2]; }
else if(GetPlayerVehicleID(playerid) == PlayerData[playerid][pPcarkey3]+PreVehicle) { ownvehkey = PlayerData[playerid][pPcarkey3]; }
else if(GetPlayerVehicleID(playerid) == PlayerData[playerid][pPcarkey4]+PreVehicle) { ownvehkey = PlayerData[playerid][pPcarkey4]; }
else if(GetPlayerVehicleID(playerid) == PlayerData[playerid][pPcarkey5]+PreVehicle) { ownvehkey = PlayerData[playerid][pPcarkey5]; }
 else { return 1; }
 if(strcmp(sendername, CarData[ownvehkey][cOwner], true) == 0 )
 {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
 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;
}

Imagini / Video (optional):

Ati incercat sa rezolvati singur?:DA si nu am reusit 

 

iar asta e ce accepti 

 

else if(strcmp(x_job,"ownablecar",true) == 0)

{
 if(OwnableCarOffer[playerid] < 999)
 {
 if(OwnableCarID[playerid] == 0) { return 1; }
 if(OwnableCarPrice[playerid] == 0 || OwnableCarPrice[playerid] > 1000000000) { return 1; }
 
 if(OwnableCarID[playerid] == PlayerData[OwnableCarOffer[playerid]][pPcarkey]) { }
 else if(OwnableCarID[playerid] == PlayerData[OwnableCarOffer[playerid]][pPcarkey2]) { }
 else if(OwnableCarID[playerid] == PlayerData[OwnableCarOffer[playerid]][pPcarkey3]) { }
else if(OwnableCarID[playerid] == PlayerData[OwnableCarOffer[playerid]][pPcarkey4]) { }
 else if(OwnableCarID[playerid] == PlayerData[OwnableCarOffer[playerid]][pPcarkey5]) { }
 else { SendClientMessage(playerid, COLOR_GREY, "Oferta numai este valabila"); return 1; }
 if(GetPlayerCash(playerid) >= OwnableCarPrice[playerid])
 {
if(IsPlayerConnected(OwnableCarOffer[playerid]))
{
 GetPlayerName(OwnableCarOffer[playerid], giveplayer, sizeof(giveplayer));
 GetPlayerName(playerid, sendername, sizeof(sendername));
 if(PlayerData[playerid][pPcarkey] == 999)
{
if(GetPlayerVehicleID(OwnableCarOffer[playerid])-PreVehicle == PlayerData[OwnableCarOffer[playerid]][pPcarkey])
{
PlayerData[playerid][pPcarkey] = PlayerData[OwnableCarOffer[playerid]][pPcarkey];
  PlayerData[OwnableCarOffer[playerid]][pPcarkey] = 999;
  format(string, sizeof(string), "UPDATE players SET Car='%d' WHERE id=%d", PlayerData[playerid][pPcarkey], PlayerData[playerid][pSQLID]);
mysql_query(string);
format(string, sizeof(string), "UPDATE players SET Car='%d' WHERE id=%d", PlayerData[OwnableCarOffer[playerid]][pPcarkey], PlayerData[OwnableCarOffer[playerid]][pSQLID]);
mysql_query(string);
}
else if(GetPlayerVehicleID(OwnableCarOffer[playerid])-PreVehicle == PlayerData[OwnableCarOffer[playerid]][pPcarkey2])
{
PlayerData[playerid][pPcarkey2] = PlayerData[OwnableCarOffer[playerid]][pPcarkey2];
  PlayerData[OwnableCarOffer[playerid]][pPcarkey2] = 999;
  format(string, sizeof(string), "UPDATE players SET Car2='%d' WHERE id=%d", PlayerData[playerid][pPcarkey2], PlayerData[playerid][pSQLID]);
mysql_query(string);
format(string, sizeof(string), "UPDATE players SET Car2='%d' WHERE id=%d", PlayerData[OwnableCarOffer[playerid]][pPcarkey2], PlayerData[OwnableCarOffer[playerid]][pSQLID]);
mysql_query(string);
}
else if(GetPlayerVehicleID(OwnableCarOffer[playerid])-PreVehicle == PlayerData[OwnableCarOffer[playerid]][pPcarkey3])
{
PlayerData[playerid][pPcarkey3] = PlayerData[OwnableCarOffer[playerid]][pPcarkey3];
  PlayerData[OwnableCarOffer[playerid]][pPcarkey3] = 999;
  format(string, sizeof(string), "UPDATE players SET Car3='%d' WHERE id=%d", PlayerData[playerid][pPcarkey3], PlayerData[playerid][pSQLID]);
mysql_query(string);
format(string, sizeof(string), "UPDATE players SET Car3='%d' WHERE id=%d", PlayerData[OwnableCarOffer[playerid]][pPcarkey3], PlayerData[OwnableCarOffer[playerid]][pSQLID]);
mysql_query(string);
}
else if(GetPlayerVehicleID(OwnableCarOffer[playerid])-PreVehicle == PlayerData[OwnableCarOffer[playerid]][pPcarkey4])
{
PlayerData[playerid][pPcarkey4] = PlayerData[OwnableCarOffer[playerid]][pPcarkey4];
  PlayerData[OwnableCarOffer[playerid]][pPcarkey4] = 999;
  format(string, sizeof(string), "UPDATE players SET Car4='%d' WHERE id=%d", PlayerData[playerid][pPcarkey4], PlayerData[playerid][pSQLID]);
mysql_query(string);
format(string, sizeof(string), "UPDATE players SET Car4='%d' WHERE id=%d", PlayerData[OwnableCarOffer[playerid]][pPcarkey4], PlayerData[OwnableCarOffer[playerid]][pSQLID]);
mysql_query(string);
}
else if(GetPlayerVehicleID(OwnableCarOffer[playerid])-PreVehicle == PlayerData[OwnableCarOffer[playerid]][pPcarkey5])
{
PlayerData[playerid][pPcarkey5] = PlayerData[OwnableCarOffer[playerid]][pPcarkey5];
  PlayerData[OwnableCarOffer[playerid]][pPcarkey5] = 999;
  format(string, sizeof(string), "UPDATE players SET Car5='%d' WHERE id=%d", PlayerData[playerid][pPcarkey5], PlayerData[playerid][pSQLID]);
mysql_query(string);
format(string, sizeof(string), "UPDATE players SET Car5='%d' WHERE id=%d", PlayerData[OwnableCarOffer[playerid]][pPcarkey5], PlayerData[OwnableCarOffer[playerid]][pSQLID]);
mysql_query(string);
}
else
{
 SendClientMessage(playerid, COLOR_GREY, "Cel care vinde masina trebuie sa fi in masina!");
return 1;
}
format(string, sizeof(string), "* Ai cumparat masina personala cu $%d de la %s.",OwnableCarPrice[playerid],giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* %s a cumparat masina ta personala cu $%d.",sendername,OwnableCarPrice[playerid]);
SendClientMessage(OwnableCarOffer[playerid], COLOR_WHITE, string);
  RemovePlayerFromVehicle(OwnableCarOffer[playerid]);
  GivePlayerCash(playerid, - OwnableCarPrice[playerid]);
  GivePlayerCash(OwnableCarOffer[playerid], OwnableCarPrice[playerid]);
  strmid(CarData[OwnableCarID[playerid]][cOwner], sendername, 0, strlen(sendername), 999);
format(string, sizeof(string), "UPDATE cars SET Owner='%s' WHERE id=%d", CarData[OwnableCarID[playerid]][cOwner], OwnableCarID[playerid]);
 
}
 else if(PlayerData[playerid][pPcarkey2] == 999)
{
if(GetPlayerVehicleID(OwnableCarOffer[playerid])-PreVehicle == PlayerData[OwnableCarOffer[playerid]][pPcarkey])
{
PlayerData[playerid][pPcarkey] = PlayerData[OwnableCarOffer[playerid]][pPcarkey];
  PlayerData[OwnableCarOffer[playerid]][pPcarkey] = 999;
  format(string, sizeof(string), "UPDATE players SET Car='%d' WHERE id=%d", PlayerData[playerid][pPcarkey], PlayerData[playerid][pSQLID]);
mysql_query(string);
format(string, sizeof(string), "UPDATE players SET Car='%d' WHERE id=%d", PlayerData[OwnableCarOffer[playerid]][pPcarkey], PlayerData[OwnableCarOffer[playerid]][pSQLID]);
mysql_query(string);
}
else if(GetPlayerVehicleID(OwnableCarOffer[playerid])-PreVehicle == PlayerData[OwnableCarOffer[playerid]][pPcarkey2])
{
PlayerData[playerid][pPcarkey2] = PlayerData[OwnableCarOffer[playerid]][pPcarkey2];
  PlayerData[OwnableCarOffer[playerid]][pPcarkey2] = 999;
  format(string, sizeof(string), "UPDATE players SET Car2='%d' WHERE id=%d", PlayerData[playerid][pPcarkey2], PlayerData[playerid][pSQLID]);
mysql_query(string);
format(string, sizeof(string), "UPDATE players SET Car2='%d' WHERE id=%d", PlayerData[OwnableCarOffer[playerid]][pPcarkey2], PlayerData[OwnableCarOffer[playerid]][pSQLID]);
mysql_query(string);
}
else if(GetPlayerVehicleID(OwnableCarOffer[playerid])-PreVehicle == PlayerData[OwnableCarOffer[playerid]][pPcarkey3])
{
PlayerData[playerid][pPcarkey3] = PlayerData[OwnableCarOffer[playerid]][pPcarkey3];
  PlayerData[OwnableCarOffer[playerid]][pPcarkey3] = 999;
  format(string, sizeof(string), "UPDATE players SET Car3='%d' WHERE id=%d", PlayerData[playerid][pPcarkey3], PlayerData[playerid][pSQLID]);
mysql_query(string);
format(string, sizeof(string), "UPDATE players SET Car3='%d' WHERE id=%d", PlayerData[OwnableCarOffer[playerid]][pPcarkey3], PlayerData[OwnableCarOffer[playerid]][pSQLID]);
mysql_query(string);
}
else if(GetPlayerVehicleID(OwnableCarOffer[playerid])-PreVehicle == PlayerData[OwnableCarOffer[playerid]][pPcarkey4])
{
PlayerData[playerid][pPcarkey4] = PlayerData[OwnableCarOffer[playerid]][pPcarkey4];
  PlayerData[OwnableCarOffer[playerid]][pPcarkey4] = 999;
  format(string, sizeof(string), "UPDATE players SET Car4='%d' WHERE id=%d", PlayerData[playerid][pPcarkey4], PlayerData[playerid][pSQLID]);
mysql_query(string);
format(string, sizeof(string), "UPDATE players SET Car4='%d' WHERE id=%d", PlayerData[OwnableCarOffer[playerid]][pPcarkey4], PlayerData[OwnableCarOffer[playerid]][pSQLID]);
mysql_query(string);
}
else if(GetPlayerVehicleID(OwnableCarOffer[playerid])-PreVehicle == PlayerData[OwnableCarOffer[playerid]][pPcarkey5])
{
PlayerData[playerid][pPcarkey5] = PlayerData[OwnableCarOffer[playerid]][pPcarkey5];
  PlayerData[OwnableCarOffer[playerid]][pPcarkey5] = 999;
  format(string, sizeof(string), "UPDATE players SET Car5='%d' WHERE id=%d", PlayerData[playerid][pPcarkey5], PlayerData[playerid][pSQLID]);
mysql_query(string);
format(string, sizeof(string), "UPDATE players SET Car5='%d' WHERE id=%d", PlayerData[OwnableCarOffer[playerid]][pPcarkey5], PlayerData[OwnableCarOffer[playerid]][pSQLID]);
mysql_query(string);
}
else
{
 SendClientMessage(playerid, COLOR_GREY, "Cel care vinde masina trebuie sa fie in masina!");
return 1;
}
format(string, sizeof(string), "* Ai cumparat masina personala cu $%d de la %s.",OwnableCarPrice[playerid],giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* %s a cumparat masina ta personala cu $%d.",sendername,OwnableCarPrice[playerid]);
SendClientMessage(OwnableCarOffer[playerid], COLOR_WHITE, string);
  RemovePlayerFromVehicle(OwnableCarOffer[playerid]);
  GivePlayerCash(playerid, - OwnableCarPrice[playerid]);
  GivePlayerCash(OwnableCarOffer[playerid], OwnableCarPrice[playerid]);
  strmid(CarData[OwnableCarID[playerid]][cOwner], sendername, 0, strlen(sendername), 999);
format(string, sizeof(string), "UPDATE cars SET Owner='%s' WHERE id=%d", CarData[OwnableCarID[playerid]][cOwner], OwnableCarID[playerid]);
mysql_query(string);
 
}
 else if(PlayerData[playerid][pPcarkey3] == 999)
{
if(GetPlayerVehicleID(OwnableCarOffer[playerid])-PreVehicle == PlayerData[OwnableCarOffer[playerid]][pPcarkey])
{
PlayerData[playerid][pPcarkey] = PlayerData[OwnableCarOffer[playerid]][pPcarkey];
  PlayerData[OwnableCarOffer[playerid]][pPcarkey] = 999;
  format(string, sizeof(string), "UPDATE players SET Car='%d' WHERE id=%d", PlayerData[playerid][pPcarkey], PlayerData[playerid][pSQLID]);
mysql_query(string);
format(string, sizeof(string), "UPDATE players SET Car='%d' WHERE id=%d", PlayerData[OwnableCarOffer[playerid]][pPcarkey], PlayerData[OwnableCarOffer[playerid]][pSQLID]);
mysql_query(string);
}
else if(GetPlayerVehicleID(OwnableCarOffer[playerid])-PreVehicle == PlayerData[OwnableCarOffer[playerid]][pPcarkey2])
{
PlayerData[playerid][pPcarkey2] = PlayerData[OwnableCarOffer[playerid]][pPcarkey2];
  PlayerData[OwnableCarOffer[playerid]][pPcarkey2] = 999;
  format(string, sizeof(string), "UPDATE players SET Car2='%d' WHERE id=%d", PlayerData[playerid][pPcarkey2], PlayerData[playerid][pSQLID]);
mysql_query(string);
format(string, sizeof(string), "UPDATE players SET Car2='%d' WHERE id=%d", PlayerData[OwnableCarOffer[playerid]][pPcarkey2], PlayerData[OwnableCarOffer[playerid]][pSQLID]);
mysql_query(string);
}
else if(GetPlayerVehicleID(OwnableCarOffer[playerid])-PreVehicle == PlayerData[OwnableCarOffer[playerid]][pPcarkey3])
{
PlayerData[playerid][pPcarkey3] = PlayerData[OwnableCarOffer[playerid]][pPcarkey3];
  PlayerData[OwnableCarOffer[playerid]][pPcarkey3] = 999;
  format(string, sizeof(string), "UPDATE players SET Car3='%d' WHERE id=%d", PlayerData[playerid][pPcarkey3], PlayerData[playerid][pSQLID]);
mysql_query(string);
format(string, sizeof(string), "UPDATE players SET Car3='%d' WHERE id=%d", PlayerData[OwnableCarOffer[playerid]][pPcarkey3], PlayerData[OwnableCarOffer[playerid]][pSQLID]);
mysql_query(string);
}
else if(GetPlayerVehicleID(OwnableCarOffer[playerid])-PreVehicle == PlayerData[OwnableCarOffer[playerid]][pPcarkey4])
{
PlayerData[playerid][pPcarkey4] = PlayerData[OwnableCarOffer[playerid]][pPcarkey4];
  PlayerData[OwnableCarOffer[playerid]][pPcarkey4] = 999;
  format(string, sizeof(string), "UPDATE players SET Car4='%d' WHERE id=%d", PlayerData[playerid][pPcarkey4], PlayerData[playerid][pSQLID]);
mysql_query(string);
format(string, sizeof(string), "UPDATE players SET Car4='%d' WHERE id=%d", PlayerData[OwnableCarOffer[playerid]][pPcarkey4], PlayerData[OwnableCarOffer[playerid]][pSQLID]);
mysql_query(string);
}
else if(GetPlayerVehicleID(OwnableCarOffer[playerid])-PreVehicle == PlayerData[OwnableCarOffer[playerid]][pPcarkey5])
{
PlayerData[playerid][pPcarkey5] = PlayerData[OwnableCarOffer[playerid]][pPcarkey5];
  PlayerData[OwnableCarOffer[playerid]][pPcarkey5] = 999;
  format(string, sizeof(string), "UPDATE players SET Car5='%d' WHERE id=%d", PlayerData[playerid][pPcarkey5], PlayerData[playerid][pSQLID]);
mysql_query(string);
format(string, sizeof(string), "UPDATE players SET Car5='%d' WHERE id=%d", PlayerData[OwnableCarOffer[playerid]][pPcarkey5], PlayerData[OwnableCarOffer[playerid]][pSQLID]);
mysql_query(string);
}
else
{
 SendClientMessage(playerid, COLOR_GREY, "Cel care vinde masina trebuie sa fi in masina!");
return 1;
}
format(string, sizeof(string), "* Ai cumparat masina personala cu $%d de la %s.",OwnableCarPrice[playerid],giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* %s a cumparat masina ta personala cu $%d.",sendername,OwnableCarPrice[playerid]);
SendClientMessage(OwnableCarOffer[playerid], COLOR_WHITE, string);
  RemovePlayerFromVehicle(OwnableCarOffer[playerid]);
  GivePlayerCash(playerid, - OwnableCarPrice[playerid]);
  GivePlayerCash(OwnableCarOffer[playerid], OwnableCarPrice[playerid]);
  strmid(CarData[OwnableCarID[playerid]][cOwner], sendername, 0, strlen(sendername), 999);
format(string, sizeof(string), "UPDATE cars SET Owner='%s' WHERE id=%d", CarData[OwnableCarID[playerid]][cOwner], OwnableCarID[playerid]);
mysql_query(string);
 
}
else if(PlayerData[playerid][pPcarkey4] == 999)
{
if(GetPlayerVehicleID(OwnableCarOffer[playerid])-PreVehicle == PlayerData[OwnableCarOffer[playerid]][pPcarkey])
{
PlayerData[playerid][pPcarkey] = PlayerData[OwnableCarOffer[playerid]][pPcarkey];
  PlayerData[OwnableCarOffer[playerid]][pPcarkey] = 999;
  format(string, sizeof(string), "UPDATE players SET Car='%d' WHERE id=%d", PlayerData[playerid][pPcarkey], PlayerData[playerid][pSQLID]);
mysql_query(string);
format(string, sizeof(string), "UPDATE players SET Car='%d' WHERE id=%d", PlayerData[OwnableCarOffer[playerid]][pPcarkey], PlayerData[OwnableCarOffer[playerid]][pSQLID]);
mysql_query(string);
}
else if(GetPlayerVehicleID(OwnableCarOffer[playerid])-PreVehicle == PlayerData[OwnableCarOffer[playerid]][pPcarkey2])
{
PlayerData[playerid][pPcarkey2] = PlayerData[OwnableCarOffer[playerid]][pPcarkey2];
  PlayerData[OwnableCarOffer[playerid]][pPcarkey2] = 999;
  format(string, sizeof(string), "UPDATE players SET Car2='%d' WHERE id=%d", PlayerData[playerid][pPcarkey2], PlayerData[playerid][pSQLID]);
mysql_query(string);
format(string, sizeof(string), "UPDATE players SET Car2='%d' WHERE id=%d", PlayerData[OwnableCarOffer[playerid]][pPcarkey2], PlayerData[OwnableCarOffer[playerid]][pSQLID]);
mysql_query(string);
}
else if(GetPlayerVehicleID(OwnableCarOffer[playerid])-PreVehicle == PlayerData[OwnableCarOffer[playerid]][pPcarkey3])
{
PlayerData[playerid][pPcarkey3] = PlayerData[OwnableCarOffer[playerid]][pPcarkey3];
  PlayerData[OwnableCarOffer[playerid]][pPcarkey3] = 999;
  format(string, sizeof(string), "UPDATE players SET Car3='%d' WHERE id=%d", PlayerData[playerid][pPcarkey3], PlayerData[playerid][pSQLID]);
mysql_query(string);
format(string, sizeof(string), "UPDATE players SET Car3='%d' WHERE id=%d", PlayerData[OwnableCarOffer[playerid]][pPcarkey3], PlayerData[OwnableCarOffer[playerid]][pSQLID]);
mysql_query(string);
}
else if(GetPlayerVehicleID(OwnableCarOffer[playerid])-PreVehicle == PlayerData[OwnableCarOffer[playerid]][pPcarkey4])
{
PlayerData[playerid][pPcarkey4] = PlayerData[OwnableCarOffer[playerid]][pPcarkey4];
  PlayerData[OwnableCarOffer[playerid]][pPcarkey4] = 999;
  format(string, sizeof(string), "UPDATE players SET Car4='%d' WHERE id=%d", PlayerData[playerid][pPcarkey4], PlayerData[playerid][pSQLID]);
mysql_query(string);
format(string, sizeof(string), "UPDATE players SET Car4='%d' WHERE id=%d", PlayerData[OwnableCarOffer[playerid]][pPcarkey4], PlayerData[OwnableCarOffer[playerid]][pSQLID]);
mysql_query(string);
}
else if(GetPlayerVehicleID(OwnableCarOffer[playerid])-PreVehicle == PlayerData[OwnableCarOffer[playerid]][pPcarkey5])
{
PlayerData[playerid][pPcarkey5] = PlayerData[OwnableCarOffer[playerid]][pPcarkey5];
  PlayerData[OwnableCarOffer[playerid]][pPcarkey5] = 999;
  format(string, sizeof(string), "UPDATE players SET Car5='%d' WHERE id=%d", PlayerData[playerid][pPcarkey5], PlayerData[playerid][pSQLID]);
mysql_query(string);
format(string, sizeof(string), "UPDATE players SET Car5='%d' WHERE id=%d", PlayerData[OwnableCarOffer[playerid]][pPcarkey5], PlayerData[OwnableCarOffer[playerid]][pSQLID]);
mysql_query(string);
}
else
{
 SendClientMessage(playerid, COLOR_GREY, "Cel care vinde masina trebuie sa fi in masina!");
return 1;
}
format(string, sizeof(string), "* Ai cumparat masina personala cu $%d de la %s.",OwnableCarPrice[playerid],giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* %s a cumparat masina ta personala cu $%d.",sendername,OwnableCarPrice[playerid]);
SendClientMessage(OwnableCarOffer[playerid], COLOR_WHITE, string);
  RemovePlayerFromVehicle(OwnableCarOffer[playerid]);
  GivePlayerCash(playerid, - OwnableCarPrice[playerid]);
  GivePlayerCash(OwnableCarOffer[playerid], OwnableCarPrice[playerid]);
  strmid(CarData[OwnableCarID[playerid]][cOwner], sendername, 0, strlen(sendername), 999);
format(string, sizeof(string), "UPDATE cars SET Owner='%s' WHERE id=%d", CarData[OwnableCarID[playerid]][cOwner], OwnableCarID[playerid]);
mysql_query(string);
 
}
 else if(PlayerData[playerid][pPcarkey5] == 999)
{
if(GetPlayerVehicleID(OwnableCarOffer[playerid])-PreVehicle == PlayerData[OwnableCarOffer[playerid]][pPcarkey])
{
PlayerData[playerid][pPcarkey] = PlayerData[OwnableCarOffer[playerid]][pPcarkey];
  PlayerData[OwnableCarOffer[playerid]][pPcarkey] = 999;
  format(string, sizeof(string), "UPDATE players SET Car='%d' WHERE id=%d", PlayerData[playerid][pPcarkey], PlayerData[playerid][pSQLID]);
mysql_query(string);
format(string, sizeof(string), "UPDATE players SET Car='%d' WHERE id=%d", PlayerData[OwnableCarOffer[playerid]][pPcarkey], PlayerData[OwnableCarOffer[playerid]][pSQLID]);
mysql_query(string);
}
else if(GetPlayerVehicleID(OwnableCarOffer[playerid])-PreVehicle == PlayerData[OwnableCarOffer[playerid]][pPcarkey2])
{
PlayerData[playerid][pPcarkey2] = PlayerData[OwnableCarOffer[playerid]][pPcarkey2];
  PlayerData[OwnableCarOffer[playerid]][pPcarkey2] = 999;
  format(string, sizeof(string), "UPDATE players SET Car2='%d' WHERE id=%d", PlayerData[playerid][pPcarkey2], PlayerData[playerid][pSQLID]);
mysql_query(string);
format(string, sizeof(string), "UPDATE players SET Car2='%d' WHERE id=%d", PlayerData[OwnableCarOffer[playerid]][pPcarkey2], PlayerData[OwnableCarOffer[playerid]][pSQLID]);
mysql_query(string);
}
else if(GetPlayerVehicleID(OwnableCarOffer[playerid])-PreVehicle == PlayerData[OwnableCarOffer[playerid]][pPcarkey3])
{
PlayerData[playerid][pPcarkey3] = PlayerData[OwnableCarOffer[playerid]][pPcarkey3];
  PlayerData[OwnableCarOffer[playerid]][pPcarkey3] = 999;
  format(string, sizeof(string), "UPDATE players SET Car3='%d' WHERE id=%d", PlayerData[playerid][pPcarkey3], PlayerData[playerid][pSQLID]);
mysql_query(string);
format(string, sizeof(string), "UPDATE players SET Car3='%d' WHERE id=%d", PlayerData[OwnableCarOffer[playerid]][pPcarkey3], PlayerData[OwnableCarOffer[playerid]][pSQLID]);
mysql_query(string);
}
else if(GetPlayerVehicleID(OwnableCarOffer[playerid])-PreVehicle == PlayerData[OwnableCarOffer[playerid]][pPcarkey4])
{
PlayerData[playerid][pPcarkey4] = PlayerData[OwnableCarOffer[playerid]][pPcarkey4];
  PlayerData[OwnableCarOffer[playerid]][pPcarkey4] = 999;
  format(string, sizeof(string), "UPDATE players SET Car4='%d' WHERE id=%d", PlayerData[playerid][pPcarkey4], PlayerData[playerid][pSQLID]);
mysql_query(string);
format(string, sizeof(string), "UPDATE players SET Car4='%d' WHERE id=%d", PlayerData[OwnableCarOffer[playerid]][pPcarkey4], PlayerData[OwnableCarOffer[playerid]][pSQLID]);
mysql_query(string);
}
else if(GetPlayerVehicleID(OwnableCarOffer[playerid])-PreVehicle == PlayerData[OwnableCarOffer[playerid]][pPcarkey5])
{
PlayerData[playerid][pPcarkey5] = PlayerData[OwnableCarOffer[playerid]][pPcarkey5];
  PlayerData[OwnableCarOffer[playerid]][pPcarkey5] = 999;
  format(string, sizeof(string), "UPDATE players SET Car5='%d' WHERE id=%d", PlayerData[playerid][pPcarkey5], PlayerData[playerid][pSQLID]);
mysql_query(string);
format(string, sizeof(string), "UPDATE players SET Car5='%d' WHERE id=%d", PlayerData[OwnableCarOffer[playerid]][pPcarkey5], PlayerData[OwnableCarOffer[playerid]][pSQLID]);
mysql_query(string);
}
else
{
 SendClientMessage(playerid, COLOR_GREY, "Cel care vinde masina trebuie sa fi in masina!");
return 1;
}
format(string, sizeof(string), "* Ai cumparat masina personala cu $%d de la %s.",OwnableCarPrice[playerid],giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* %s a cumparat masina ta personala cu $%d.",sendername,OwnableCarPrice[playerid]);
SendClientMessage(OwnableCarOffer[playerid], COLOR_WHITE, string);
  RemovePlayerFromVehicle(OwnableCarOffer[playerid]);
  GivePlayerCash(playerid, - OwnableCarPrice[playerid]);
  GivePlayerCash(OwnableCarOffer[playerid], OwnableCarPrice[playerid]);
  strmid(CarData[OwnableCarID[playerid]][cOwner], sendername, 0, strlen(sendername), 999);
format(string, sizeof(string), "UPDATE cars SET Owner='%s' WHERE id=%d", CarData[OwnableCarID[playerid]][cOwner], OwnableCarID[playerid]);
mysql_query(string);
 
}
 else
 {
 SendClientMessage(playerid, COLOR_GREY, "Detii deja 5 masini personale ");
 return 1;
}
 OwnableCarOffer[playerid] = 999;
OwnableCarID[playerid] = 0;
OwnableCarPrice[playerid] = 0;
GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa iti parchezi masina /v park!", 5000, 3);
SendClientMessage(playerid, COLOR_GRAD2, "Felicitari pentru noua masina!");
SendClientMessage(playerid, COLOR_GRAD2, "Scrie /v ca sa vezi comenzile!");
return 1;
}
else
{
 SendClientMessage(playerid, COLOR_GREY, "Vanzator numai este conectat!");
  return 1;
}
 }
 }
 else
 {
 SendClientMessage(playerid, COLOR_GREY, "Nimeni nu ti-a oferit sa iti vand masina lui personala!");
 return 1;
 }
}
  • 0
  •  
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.