18.02.2015, 22:59
i have same this problem help me
https://sampforum.blast.hk/showthread.php?tid=312432
code:
https://sampforum.blast.hk/showthread.php?tid=312432
code:
PHP код:
stock sellcar(playerid)
{
new string[128];
if(VehicleInfo[GetPlayerVehicleID(playerid)][Temp] == 1) {
return SendClientMessage(playerid, COLOR_ORANGE, "This vehicle is only temporary and some commands may not work!");
}
if(PlayerInfo[playerid][LoggedIn] == 0) {
SendClientMessage(playerid, COLOR_BRIGHTRED, "You must be logged in to use this feature");
return 1;
}
if(PlayerInfo[playerid][Jailed] == 1) {
SendClientMessage(playerid, COLOR_BRIGHTRED, "You are in jail and cannot use this feature");
return 1;
}
if(passenger[playerid] == 1) {
SendClientMessage(playerid, COLOR_BRIGHTRED, "You must be in the drivers' seat of your vehicle to sell it!");
return 1;
}
if(IsPlayerInAnyVehicle(playerid) == 0) {
SendClientMessage(playerid, COLOR_BRIGHTRED, "You must be inside your vehicle in order to sell it");
return 1;
}
new vehicleID = GetPlayerVehicleID(playerid);
#if defined TEMP_PARK
VehicleInfo[vehicleID][x_spawn] = VehicleInfo[vehicleID][ox_spawn];
VehicleInfo[vehicleID][y_spawn] = VehicleInfo[vehicleID][oy_spawn];
VehicleInfo[vehicleID][z_spawn] = VehicleInfo[vehicleID][oz_spawn];
VehicleInfo[vehicleID][za_spawn] = VehicleInfo[vehicleID][oza_spawn];
#endif
if (strcmp(VehicleInfo[vehicleID][owner],PlayerInfo[playerid][name],false) == 0) {
SetVehicleToRespawn(vehicleID);
SetVehicleVirtualWorld(vehicleID,10);
SetTimerEx("EraseVehicle",5000,0,"i",vehicleID);
if(PlayerInfo[playerid][vowned] == vehicleID){
PlayerInfo[playerid][vowner] = 0;
PlayerInfo[playerid][vowned] = 0;
format(string, sizeof(string), "You just sold your %s for $%d, From Calling Slot #1, enjoy the walk!!", VehicleInfo[vehicleID][name], VehicleInfo[vehicleID][vehiclecost]);
SendClientMessage(playerid, COLOR_BRIGHTRED, string);
}
else if(PlayerInfo[playerid][vowned2] == vehicleID){
PlayerInfo[playerid][vowner2] = 0;
PlayerInfo[playerid][vowned2] = 0;
format(string, sizeof(string), "You just sold your %s for $%d, From Calling Slot #2, enjoy the walk!!", VehicleInfo[vehicleID][name], VehicleInfo[vehicleID][vehiclecost]);
SendClientMessage(playerid, COLOR_BRIGHTRED, string);
}
else if(PlayerInfo[playerid][vowned3] == vehicleID){
PlayerInfo[playerid][vowner3] = 0;
PlayerInfo[playerid][vowned3] = 0;
format(string, sizeof(string), "You just sold your %s for $%d, From Calling Slot #3, enjoy the walk!!", VehicleInfo[vehicleID][name], VehicleInfo[vehicleID][vehiclecost]);
SendClientMessage(playerid, COLOR_BRIGHTRED, string);
}
else if(PlayerInfo[playerid][vowned4] == vehicleID){
PlayerInfo[playerid][vowner4] = 0;
PlayerInfo[playerid][vowned4] = 0;
format(string, sizeof(string), "You just sold your %s for $%d, From Calling Slot #4, enjoy the walk!!", VehicleInfo[vehicleID][name], VehicleInfo[vehicleID][vehiclecost]);
SendClientMessage(playerid, COLOR_BRIGHTRED, string);
}
else if(PlayerInfo[playerid][vowned5] == vehicleID){
PlayerInfo[playerid][vowner5] = 0;
PlayerInfo[playerid][vowned5] = 0;
format(string, sizeof(string), "You just sold your %s for $%d, From Calling Slot #5, enjoy the walk!!", VehicleInfo[vehicleID][name], VehicleInfo[vehicleID][vehiclecost]);
SendClientMessage(playerid, COLOR_BRIGHTRED, string);
}
else if(PlayerInfo[playerid][vowned6] == vehicleID){
PlayerInfo[playerid][vowner6] = 0;
PlayerInfo[playerid][vowned6] = 0;
format(string, sizeof(string), "You just sold your %s for $%d, From Calling Slot #6, enjoy the walk!!", VehicleInfo[vehicleID][name], VehicleInfo[vehicleID][vehiclecost]);
SendClientMessage(playerid, COLOR_BRIGHTRED, string);
}
else if(PlayerInfo[playerid][vowned7] == vehicleID){
PlayerInfo[playerid][vowner7] = 0;
PlayerInfo[playerid][vowned7] = 0;
format(string, sizeof(string), "You just sold your %s for $%d, From Calling Slot #7, enjoy the walk!!", VehicleInfo[vehicleID][name], VehicleInfo[vehicleID][vehiclecost]);
SendClientMessage(playerid, COLOR_BRIGHTRED, string);
}
else if(PlayerInfo[playerid][vowned8] == vehicleID){
PlayerInfo[playerid][vowner8] = 0;
PlayerInfo[playerid][vowned8] = 0;
format(string, sizeof(string), "You just sold your %s for $%d, From Calling Slot #8, enjoy the walk!!", VehicleInfo[vehicleID][name], VehicleInfo[vehicleID][vehiclecost]);
SendClientMessage(playerid, COLOR_BRIGHTRED, string);
}
strmid(VehicleInfo[vehicleID][owner], DEFAULT_OWNER, 0, strlen(DEFAULT_OWNER), 255);
VehicleInfo[vehicleID][bought] = 0;
VehicleInfo[vehicleID][secure] = 0;
GivePlayerMoney(playerid, VehicleInfo[vehicleID][vehiclecost]);
// format(string, sizeof(string), "You just sold your %s for $%d, enjoy the walk!!", VehicleInfo[vehicleID][name], VehicleInfo[vehicleID][vehiclecost]);
// SendClientMessage(playerid, COLOR_BRIGHTRED, string);
SavePlayer(playerid);
return 1;
}
else {
SendClientMessage(playerid, COLOR_BRIGHTRED, "What are you trying to pull here, you don't own the vehicle!!!");
return 1;
}
}