19.08.2011, 09:05
pawn Код:
if(strcmp(cmd, "/venderveh", true) == 0)
{
new vehid;
if(!IsAtDealership(playerid))
{
if(EsVehiculoDePropiedad(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh1]) { vehid = JugadorStats[playerid][uLlaveVeh1]; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh2]) { vehid = JugadorStats[playerid][uLlaveVeh2]; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh3]) { vehid = JugadorStats[playerid][uLlaveVeh3]; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh4]) { vehid = JugadorStats[playerid][uLlaveVeh4]; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh5]) { vehid = JugadorStats[playerid][uLlaveVeh5]; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh6]) { vehid = JugadorStats[playerid][uLlaveVeh6]; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh7]) { vehid = JugadorStats[playerid][uLlaveVeh7]; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh8]) { vehid = JugadorStats[playerid][uLlaveVeh8]; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh9]) { vehid = JugadorStats[playerid][uLlaveVeh9]; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh10]) { vehid = JugadorStats[playerid][uLlaveVeh10]; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh11]) { vehid = JugadorStats[playerid][uLlaveVeh11]; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh12]) { vehid = JugadorStats[playerid][uLlaveVeh12]; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh13]) { vehid = JugadorStats[playerid][uLlaveVeh13]; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh14]) { vehid = JugadorStats[playerid][uLlaveVeh14]; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh15]) { vehid = JugadorStats[playerid][uLlaveVeh15]; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh16]) { vehid = JugadorStats[playerid][uLlaveVeh16]; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh17]) { vehid = JugadorStats[playerid][uLlaveVeh17]; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh18]) { vehid = JugadorStats[playerid][uLlaveVeh18]; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh19]) { vehid = JugadorStats[playerid][uLlaveVeh19]; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh20]) { vehid = JugadorStats[playerid][uLlaveVeh20]; }
else { return 1; }
if(strcmp(sendername, VehiculoInformacion[vehid][uDueno], true) == 0)
{
if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh1]) { JugadorStats[playerid][uLlaveVeh1] = 1999; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh2]) { JugadorStats[playerid][uLlaveVeh2] = 1999; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh3]) { JugadorStats[playerid][uLlaveVeh3] = 1999; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh4]) { JugadorStats[playerid][uLlaveVeh4] = 1999; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh5]) { JugadorStats[playerid][uLlaveVeh5] = 1999; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh6]) { JugadorStats[playerid][uLlaveVeh6] = 1999; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh7]) { JugadorStats[playerid][uLlaveVeh7] = 1999; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh8]) { JugadorStats[playerid][uLlaveVeh8] = 1999; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh9]) { JugadorStats[playerid][uLlaveVeh9] = 1999; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh10]) { JugadorStats[playerid][uLlaveVeh10] = 1999; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh11]) { JugadorStats[playerid][uLlaveVeh11] = 1999; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh12]) { JugadorStats[playerid][uLlaveVeh12] = 1999; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh13]) { JugadorStats[playerid][uLlaveVeh13] = 1999; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh14]) { JugadorStats[playerid][uLlaveVeh14] = 1999; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh15]) { JugadorStats[playerid][uLlaveVeh15] = 1999; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh16]) { JugadorStats[playerid][uLlaveVeh16] = 1999; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh17]) { JugadorStats[playerid][uLlaveVeh17] = 1999; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh18]) { JugadorStats[playerid][uLlaveVeh18] = 1999; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh19]) { JugadorStats[playerid][uLlaveVeh19] = 1999; }
else if(GetPlayerVehicleID(playerid) == JugadorStats[playerid][uLlaveVeh20]) { JugadorStats[playerid][uLlaveVeh20] = 1999; }
TogglePlayerControllable(playerid, 1);
VehiculoInformacion[vehid][uModelo] = 0;
VehiculoInformacion[vehid][uIDueno] = 0;
VehiculoInformacion[vehid][uDueno] = 0;
VehiculoInformacion[vehid][uSpawnx] = 0;
VehiculoInformacion[vehid][uSpawny] = 0;
VehiculoInformacion[vehid][uSpawnz] = 0;
VehiculoInformacion[vehid][uAngulo] = 0;
VehiculoInformacion[vehid][uColorUno] = 0;
VehiculoInformacion[vehid][uColorDos] = 0;
VehiculoInformacion[vehid][uValor] = 0;
VehiculoInformacion[vehid][uCerrado] = 0;
VehiculoInformacion[vehid][uLicencia] = 0;
GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~n~~n~~n~~w~Vendiste tu auto", 3500, 3);
DestroyVehicle(vehid);
OnPropUpdate();
OnPlayerUpdate(playerid);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Necesitas traer el coche para venderlo! ");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "No estas en un concesionario");
return 1;
}
}