29.01.2012, 19:10
Buenas, saben que desde que implementй un sistema premium de tener mбs autos, los premium no los pueden vender, hasta el slot 3 lo venden, pero desde el 4 hasta el 7 no se pueden vender, їquй serб?, les dejo los cуdigos:
pawn Код:
if(strcmp(x_nr,"vender",true) == 0)
{
if(IsAtDealership(playerid))
{
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]|| GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey4] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey5] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey6] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey7])
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new ownvehkey;
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { ownvehkey = PlayerInfo[playerid][pPcarkey]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { ownvehkey = PlayerInfo[playerid][pPcarkey2]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { ownvehkey = PlayerInfo[playerid][pPcarkey3]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey4]) { ownvehkey = PlayerInfo[playerid][pPcarkey4]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey5]) { ownvehkey = PlayerInfo[playerid][pPcarkey5]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey6]) { ownvehkey = PlayerInfo[playerid][pPcarkey6]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey7]) { ownvehkey = PlayerInfo[playerid][pPcarkey7]; }
else { return 1; }
if(strcmp(sendername, CarInfo[ownvehkey][cOwner], true) == 0)
{
new carsellprice = CarInfo[ownvehkey][cValue] / 4 * 3;
new Float:x,Float:y,Float:z;
new Float:a;
CarInfo[ownvehkey][cOwned] = 0;
strmid(CarInfo[ownvehkey][cOwner], "Dealership", 0, strlen("Dealership"), 999);
SafeGivePlayerMoney(playerid,carsellprice);
engineOn[GetPlayerVehicleID(playerid)] = false;
SBizzInfo[11][sbTill] -= carsellprice*2; // Conce Lujo
SBizzInfo[16][sbTill] -= carsellprice; // Conce Normal
SBizzInfo[22][sbTill] -= carsellprice/2; // Conce Barato
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~Vendiste el Coche Por: ~n~~g~$%d", carsellprice);
GameTextForPlayer(playerid, string, 10000, 3);
GetVehiclePos(ownvehkey, x, y, z);
GetVehicleZAngle(ownvehkey, a);
CarInfo[ownvehkey][cLocationx] = x;
gEngine[playerid] = 0;
CarInfo[ownvehkey][cLocationy] = y;
CarInfo[ownvehkey][cLocationz] = z;
CarInfo[ownvehkey][cAngle] = a;
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { PlayerInfo[playerid][pPcarkey] = 999; PlayerInfo[playerid][pMatricula] = 0; PlayerInfo[playerid][pEmbargos] = 0;}
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { PlayerInfo[playerid][pPcarkey2] = 999; PlayerInfo[playerid][pMatricula2] = 0; PlayerInfo[playerid][pEmbargos2] = 0;}
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { PlayerInfo[playerid][pPcarkey3] = 999; PlayerInfo[playerid][pMatricula3] = 0; PlayerInfo[playerid][pEmbargos3] = 0;}
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey4]) { PlayerInfo[playerid][pPcarkey4] = 999; PlayerInfo[playerid][pMatricula4] = 0; PlayerInfo[playerid][pEmbargos4] = 0;}
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey5]) { PlayerInfo[playerid][pPcarkey5] = 999; PlayerInfo[playerid][pMatricula5] = 0; PlayerInfo[playerid][pEmbargos5] = 0;}
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey6]) { PlayerInfo[playerid][pPcarkey6] = 999; PlayerInfo[playerid][pMatricula6] = 0; PlayerInfo[playerid][pEmbargos6] = 0;}
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey7]) { PlayerInfo[playerid][pPcarkey7] = 999; PlayerInfo[playerid][pMatricula7] = 0; PlayerInfo[playerid][pEmbargos7] = 0;}
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
if(PlayerInfo[playerid][pLocal] == ownvehkey)
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,CarInfo[ownvehkey][cLocationx],CarInfo[ownvehkey][cLocationy],CarInfo[ownvehkey][cLocationz]);
PlayerInfo[playerid][pInt] = 0;
}
OnPropUpdate();
PlayerUpdate(playerid);
DestroyVehicle(ownvehkey);
CreateVehicle(CarInfo[ownvehkey][cModel],CarInfo[ownvehkey][cLocationx],CarInfo[ownvehkey][cLocationy],CarInfo[ownvehkey][cLocationz]+1.0,CarInfo[ownvehkey][cAngle],CarInfo[ownvehkey][cColorOne],CarInfo[ownvehkey][cColorTwo],60000);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Necesitas Estar Montado en Tu Coche para Venderlo..");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "No Estбs En Una Concesionaria");
return 1;
}
}
else if(strcmp(x_nr,"vendera",true) == 0)
{
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3])
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new ownvehkey;
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { ownvehkey = PlayerInfo[playerid][pPcarkey]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { ownvehkey = PlayerInfo[playerid][pPcarkey2]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { ownvehkey = PlayerInfo[playerid][pPcarkey3]; }
else { return 1; }
if(strcmp(sendername, CarInfo[ownvehkey][cOwner], true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Uso: /v vendera [ID/Nombre] [precio]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(PlayerInfo[giveplayerid][pLevel] < 2)
{
SendClientMessage(giveplayerid, COLOR_YELLOW, "Necesitas Tener Nivel 2 Para Poder Vender Un Coche.");
SendClientMessage(playerid, COLOR_YELLOW, "Lo Siento, Ese Jugador Necesita Minimo Nivel 2.");
return 0;//WORKING HERE
}
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(ProxDetectorS(8.0, playerid, giveplayerid))
{
if(PlayerInfo[giveplayerid][pPcarkey] == 999)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Usa: /V VenderA [ID] [Precio]");
return 1;
}
new price;
price = strval(tmp);
if(price < 50000 || price > 2000000)
{
SendClientMessage(playerid, COLOR_GREY, "El rango de venta debe estar entre 50000 y 2'000.000");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* Ofreciste Tu Coche a %s Por valor de: $%d.", giveplayer, price);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* El personaje %s Te Ofreciу Su Coche Por: $%d (Escriba: /Aceptar CocheL, Para Aceptarlo).", playername, price);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
OwnableCarOffer[giveplayerid] = playerid;
OwnableCarID[giveplayerid] = ownvehkey;
OwnableCarPrice[giveplayerid] = price;
return 1;
}
if(PlayerInfo[giveplayerid][pPcarkey2] == 999)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Usa: /V VenderA [ID] [Precio]");
return 1;
}
new price;
price = strval(tmp);
if(price < 50000 || price > 2000000)
{
SendClientMessage(playerid, COLOR_GREY, "El rango de venta debe estar entre 50000 y 2'000.000");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* Ofreciste Tu Coche a %s Por valor de: $%d.", giveplayer, price);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* El personaje %s Te Ofreciу Su Coche Por: $%d (Escriba: /Aceptar CocheL, Para Aceptarlo).", playername, price);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
OwnableCarOffer[giveplayerid] = playerid;
OwnableCarID[giveplayerid] = ownvehkey;
OwnableCarPrice[giveplayerid] = price;
return 1;
}
if(PlayerInfo[giveplayerid][pPcarkey3] == 999)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Uso: /V VenderA [ID] [Precio]");
return 1;
}
new price;
price = strval(tmp);
if(price < 1 || price > 1500000)
{
SendClientMessage(playerid, COLOR_GREY, "El rango de venta debe estar entre 50000 y 2'000.000");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* Ofreciste Tu Coche a %s Por valor de: $%d.", giveplayer, price);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* El personaje %s Te Ofreciу Su Coche Por: $%d (Escriba: /Aceptar CocheL, Para Aceptarlo).", playername, price);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
OwnableCarOffer[giveplayerid] = playerid;
OwnableCarID[giveplayerid] = ownvehkey;
OwnableCarPrice[giveplayerid] = price;
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Ese Jugador, Posee 3 Coches, por esto no podrб comprar tu auto.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Jugador Muy Alejado.");
return 1;
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "No Estбs En Tu Coche.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Necesitas Estardentro de Tu Coche, Para Poder Venderlo.");
return 1;
}
}