18.05.2011, 08:12
How to remove it??
pawn Код:
//--------CAR_OWNERSHIP_COMMANDS--------------------------------------------
if(strcmp(cmd, "/vehiclehelp", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pPcarkey]!=999 && PlayerInfo[playerid][pPcarkey]!=999 && PlayerInfo[playerid][pPcarkey]!=999)
{
SendClientMessage(playerid, COLOR_GREEN,"________________Vehicle Help________________");
SendClientMessage(playerid, COLOR_GRAD2,"*** VEHICLE *** /v [name]");
SendClientMessage(playerid, COLOR_GRAD3,"*** VEHICLE *** Available names: park, lock, sell, color, tow, locate");
SendClientMessage(playerid, COLOR_GRAD4,"*** OTHER *** /cellphonehelp /help /notehelp /renthelp /businesshelp /leaderhelp /fishhelp /cookhelp /irchelp");
return 1;
}
else
{
SendClientMessage(playerid,COLOR_GRAD2,"** You do not currently own a car! **");
return 1;
}
}
return 1;
}
if(strcmp(cmd, "/apark", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new Float:x,Float:y,Float:z;
new Float:a;
new carid;
carid = GetPlayerVehicleID(playerid);
GetPlayerName(playerid, playername, sizeof(playername));
GetVehiclePos(carid, x, y, z);
// GetPlayerFacingAngle(playerid, a);
GetVehicleZAngle(carid, a);
if(PlayerInfo[playerid][pAdmin] >= 3)
{
CarInfo[carid][cLocationx] = x;
CarInfo[carid][cLocationy] = y;
CarInfo[carid][cLocationz] = z;
CarInfo[carid][cAngle] = a;
format(string, sizeof(string), "~n~ You have parked your car in this location. ~n~");
GameTextForPlayer(playerid, "You have parked this car in this position. It will respawn here.", 10000, 3);
OnPropUpdate();
OnPlayerUpdateEx(playerid);
DestroyVehicle(carid);
CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not authorized to use that command !");
return 1;
}
}
return 1;
}
if(strcmp(cmd, "/locatecar", true) == 0)
{
if(!IsPlayerConnected(playerid)) { return 1; }
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
{
SendClientMessage(playerid, COLOR_GREY, " On a mission right now, can't use this command !");
return 1;
}
new Float:x,Float:y,Float:z;
new car = PlayerInfo[playerid][pPcarkey];
if(PlayerInfo[playerid][pPcarkey]==999) { GameTextForPlayer(playerid, "~w~You do not have a car to locate", 2500, 3); return 1; }
SendClientMessage(playerid,COLOR_WHITE,"Car spawn location is red on a map");
GetVehiclePos(car, x, y, z);
SetPlayerCheckpoint(playerid, x, y, z, 6);
CP[playerid] = 987;
return 1;
}
/*if(strcmp(cmd, "/carlocate", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pPcarkey] != 999)
{
if(PlayerInfo[playerid][pPnumber] != 0)
{
if(gPlayerCheckPointStatus[playerid] != CHECKPOINT_CAR)
{
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
format(string,sizeof(string),"** %s takes out a cellphone",sendername);
ProxDetector(15.0,playerid,string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
Wait(5000);
SendClientMessage(playerid,COLOR_WHITE,"On-Star: This is On-Star how can I help you?");
Wait(2000);
format(string,sizeof(string),"%s says: [Cell] I'd like to locate a stolen vehicle",sendername");
ProxDetector(15.0,playerid,string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
Wait(2000);
SendClientMessage(playerid,COLOR_WHIE,"On-Star: Okay sir, can I have your name and identification number please");
Wait(2000);
format(string,sizeof(string),"%s enters in the information into their cellphone",sendername);
ProxDetector(15.0,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
Wait(2000);
SendClientMessage(playerid,COLOR_WHITE,"On-Star: Okay sir, your car location is being uploaded to your phone.");
Wait(500);
SendClientMessage(playerid,COLOR_WHITE,"On-Star: If you wish to cancel the trace of your car, call this number again");
Wait(500);
SetPlayerCheckpoint(playerid,CarInfo[PlayerInfo[playerid][pPcarkey]][cLocationx], CarInfo[PlayerInfo[playerid][pPcarkey]][cLocationy], CarInfo[PlayerInfo[playerid][pPcarkey]][cLocationz], 5.0);
gPlayerCheckpointStatus[playerid] = CHECKPOINT_CAR;
return 1;
}
else
{
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
Wait(1000);
SendClientMessage(playerid,COLOR_WHITE,"Your tracking of your vehicle has been automatically cancelled");
return 1;
}
}
else
{
SendClientMessage(playerid,
}
}
else
{
GameTextForPlayer(playerid, "~w~You do not have a car to locate", 5000, 1);
}
}
return 1;
}*/
//--------END_CAR_OWNERSHIP_COMMANDS----------------------------------------
if(CarInfo[newcar][cOwned]==0)
{
TogglePlayerControllable(playerid, 0);
format(string,sizeof(string),"~w~Vehicle: %s~n~Price: ~g~%d~n~~w~/v buy to buy this vehicle~n~~r~/exit ~w~to exit this vehicle",CarInfo[newcar][cDescription],CarInfo[newcar][cValue]);
GameTextForPlayer(playerid,string,5000,5);
}
if(CarInfo[newcar][cOwned]>=1)
{
format(string,sizeof(string),"This car is owned by %s",CarInfo[newcar][cOwner]);
SendClientMessage(playerid, COLOR_BLUE, string);
/*if(keycar != vehicle)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY, "You don't have a key of this vehicle");
}*/
if(PlayerInfo[playerid][pPcarkey] == vehicle) { }
else if(PlayerInfo[playerid][pPcarkey2] == vehicle) { }
else if(PlayerInfo[playerid][pPcarkey3] == vehicle) { }
else
{
if(PlayerInfo[playerid][pAdmin] >= 5 && AdminDuty[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " You can drive this car because you are admin on duty !");
}
else
{
//RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY, "You don't have a key of this vehicle");
}
---------------------------------------[Alte comenzi]----------------------------------------------------------------------------------------------------
if(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/vehicle", true) == 0)
SendClientMessage(playerid, COLOR_WHITE, "HINT: (/v)ehicle [name]");
SendClientMessage(playerid, COLOR_WHITE, "Available names: park, lock, sell, color, tow, locate");
return 1;
}
if(strcmp(x_nr,"sell",true) == 0)
{
if(IsAtDealership(playerid))
{
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)
{
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);
GivePlayerCash(playerid,carsellprice);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~You have sold your car for: ~n~~g~$%d", carsellprice);
GameTextForPlayer(playerid, string, 10000, 3);
GetVehiclePos(ownvehkey, x, y, z);
GetVehicleZAngle(ownvehkey, a);
CarInfo[ownvehkey][cLocationx] = x;
CarInfo[ownvehkey][cLocationy] = y;
CarInfo[ownvehkey][cLocationz] = z;
CarInfo[ownvehkey][cAngle] = a;
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { PlayerInfo[playerid][pPcarkey] = 999; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { PlayerInfo[playerid][pPcarkey2] = 999; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { PlayerInfo[playerid][pPcarkey3] = 999; }
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();
OnPlayerUpdateEx(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, " You have to sit at your own car to sell it! ");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You are not at a dealership");
return 1;
}
}
else if(strcmp(x_nr,"sellto",true) == 0)
{
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey])
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new ownvehkey;
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { ownvehkey = PlayerInfo[playerid][pPcarkey]; }
else { return 1; }
if(strcmp(sendername, CarInfo[ownvehkey][cOwner], true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "HINT: /v sellto [playerid/PartOfName] [price]");
return 1;
}
giveplayerid = ReturnUser(tmp);
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, "HINT: /v sellto [playerid/PartOfName] [price]");
return 1;
}
new price;
price = strval(tmp);
if(price < 1 || price > 1500000)
{
SendClientMessage(playerid, COLOR_GREY, " Price not lower then 1 and not higher then 1500000. ");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You offerd %s to buy your car for $%d .", giveplayer, price);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* Car Owner %s offered you to buy his/her car for $%d (type /accept ownablecar) to buy.", playername, price);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
OwnableCarOffer[giveplayerid] = playerid;
OwnableCarID[giveplayerid] = ownvehkey;
OwnableCarPrice[giveplayerid] = price;
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "That player already have a car! ");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Player is not near you ! ");
return 1;
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " This is not your car");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You have to sit at your own car to sell it");
return 1;
}
}
else if(strcmp(x_nr,"tow",true) == 0)
{
if(IsPlayerConnected(playerid))
{
new car = PlayerInfo[playerid][pPcarkey];
GetPlayerName(playerid, playername, sizeof(playername));
if (car != 999 && strcmp(playername, CarInfo[PlayerInfo[playerid][pPcarkey]][cOwner], true) == 0)
{
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
{
SendClientMessage(playerid, COLOR_GREY, " On a mission right now, can't use this command !");
return 1;
}
if(SBizzInfo[8][sbProducts] == 0)
{
GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
return 1;
}
if(CarTow(car))
{
GameTextForPlayer(playerid, "~w~Car~n~~g~Towed~n~~r~$-10000", 5000, 1);
GivePlayerCash(playerid,-10000);
SetVehicleToRespawn(car);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SBizzInfo[8][sbTill] += 1000;//towcar buisness
ExtortionSBiz(8, 100);
SBizzInfo[8][sbProducts]--;
}
else
{
GameTextForPlayer(playerid, "~w~Car is~n~in ~r~use", 5000, 1);
}
}
else
{
GameTextForPlayer(playerid, "~w~You are not a car owner", 5000, 1);
}
}
}
else if(strcmp(x_nr,"locate",true) == 0)
{
if(!IsPlayerConnected(playerid)) { return 1; }
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
{
SendClientMessage(playerid, COLOR_GREY, " On a mission right now, can't use this command !");
return 1;
}
new Float:x,Float:y,Float:z;
new car = PlayerInfo[playerid][pPcarkey];
if(PlayerInfo[playerid][pPcarkey]==999) { GameTextForPlayer(playerid, "~w~You do not have a car to locate", 2500, 3); return 1; }
SendClientMessage(playerid,COLOR_WHITE,"Car location is at red marker on a map");
GetVehiclePos(car, x, y, z);
SetPlayerCheckpoint(playerid, x, y, z, 6);
return 1;
}
else if(strcmp(x_nr,"park",true) == 0)
{
new Float:x,Float:y,Float:z;
new Float:a;
new carid;
new getcarid;
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { carid = PlayerInfo[playerid][pPcarkey]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { carid = PlayerInfo[playerid][pPcarkey2]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { carid = PlayerInfo[playerid][pPcarkey3]; }
else { return 1; }
getcarid = GetPlayerVehicleID(playerid);
GetPlayerName(playerid, playername, sizeof(playername));
GetVehiclePos(carid, x, y, z);
//GetPlayerFacingAngle(playerid, a);
GetVehicleZAngle(carid, a);
if(IsPlayerInVehicle(playerid,carid) && CarInfo[carid][cOwned] == 1)
{
if(PlayerInfo[playerid][pPcarkey] == 999 && PlayerInfo[playerid][pPcarkey2] == 999 & PlayerInfo[playerid][pPcarkey3])
{
SendClientMessage(playerid, COLOR_GREY, "You don't own a car.");
return 1;
}
if(getcarid == carid)
{
CarInfo[carid][cLocationx] = x;
CarInfo[carid][cLocationy] = y;
CarInfo[carid][cLocationz] = z;
CarInfo[carid][cAngle] = a;
format(string, sizeof(string), "~n~ You have parked your vehicle in this location. ~n~");
GameTextForPlayer(playerid, "You have parked your vehicle in this position. It will respawn here.", 10000, 3);
OnPropUpdate();
OnPlayerUpdateEx(playerid);
DestroyVehicle(carid);
CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000);
TogglePlayerControllable(playerid, 1);
return 1;
}
}
}
else if(strcmp(x_nr,"lock",true) == 0)
{
new keycar = PlayerInfo[playerid][pPcarkey];
if(keycar != 999)
{
new locked[256];
locked = strtok(cmdtext, idx);
if(CarInfo[keycar][cLock] == 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(keycar,i,0,0);
}
}
format(string, sizeof(string), "~w~Vehicle~n~~g~Unlocked");
GameTextForPlayer(playerid, string, 4000, 3);
CarInfo[keycar][cLock] = 0;
OnPropUpdate();
return 1;
}
else if(CarInfo[keycar][cLock] == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(keycar,i,0,1);
}
}
format(string, sizeof(string), "~w~Vehicle~n~~r~Locked");
GameTextForPlayer(playerid, string, 4000, 3);
CarInfo[keycar][cLock] = 1;
OnPropUpdate();
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You don't have a vehicle at slot 1");
return 1;
}
}
else if(strcmp(x_nr,"lock2",true) == 0)
{
new keycar = PlayerInfo[playerid][pPcarkey2];
if(keycar != 999)
{
new locked[256];
locked = strtok(cmdtext, idx);
if(CarInfo[keycar][cLock] == 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(keycar,i,0,0);
}
}
format(string, sizeof(string), "~w~Vehicle~n~~g~Unlocked");
GameTextForPlayer(playerid, string, 4000, 3);
CarInfo[keycar][cLock] = 0;
OnPropUpdate();
return 1;
}
else if(CarInfo[keycar][cLock] == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(keycar,i,0,1);
}
}
format(string, sizeof(string), "~w~Vehicle~n~~r~Locked");
GameTextForPlayer(playerid, string, 4000, 3);
CarInfo[keycar][cLock] = 1;
OnPropUpdate();
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You don't have a vehicle at slot 2");
return 1;
}
}
else if(strcmp(x_nr,"lock3",true) == 0)
{
new keycar = PlayerInfo[playerid][pPcarkey3];
if(keycar != 999)
{
new locked[256];
locked = strtok(cmdtext, idx);
if(CarInfo[keycar][cLock] == 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(keycar,i,0,0);
}
}
format(string, sizeof(string), "~w~Vehicle~n~~g~Unlocked");
GameTextForPlayer(playerid, string, 4000, 3);
CarInfo[keycar][cLock] = 0;
OnPropUpdate();
return 1;
}
else if(CarInfo[keycar][cLock] == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(keycar,i,0,1);
}
}
format(string, sizeof(string), "~w~Vehicle~n~~r~Locked");
GameTextForPlayer(playerid, string, 4000, 3);
CarInfo[keycar][cLock] = 1;
OnPropUpdate();
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You don't have a vehicle at slot 3");
return 1;
}
}
else if(strcmp(x_nr,"color",true) == 0)
{
if(PlayerInfo[playerid][pPcarkey] == 999 && PlayerInfo[playerid][pPcarkey2] == 999 && PlayerInfo[playerid][pPcarkey3] == 999)
{
SendClientMessage(playerid, COLOR_GREY," You don't have a vehicle to respray.");
return 1;
}
if(GetPlayerCash(playerid) < 1000)
{
SendClientMessage(playerid, COLOR_GREY," You don't have enough money for vehicle respray.");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /v color [ColorOneID] [ColorTwoID]");
return 1;
}
new color1;
color1 = strval(tmp);
if(color1 < 0 && color1 > 126)
{
SendClientMessage(playerid, COLOR_GREY, " Wrong color id!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /v color [ColorOneID] [ColorTwoID]");
return 1;
}
new color2;
color2 = strval(tmp);
if(color2 < 0 && color2 > 126)
{
SendClientMessage(playerid, COLOR_GREY, " Wrong color id!");
return 1;
}
new vehid;
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { vehid = PlayerInfo[playerid][pPcarkey]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { vehid = PlayerInfo[playerid][pPcarkey2]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { vehid = PlayerInfo[playerid][pPcarkey3]; }
else { return 1; }
if(IsPlayerInVehicle(playerid, vehid))
{
CarInfo[vehid][cColorOne] = color1;
CarInfo[vehid][cColorTwo] = color2;
GivePlayerCash(playerid, -1000);
GameTextForPlayer(playerid, "~w~Bill for a Paint Respray~n~~r~-$1000", 5000, 1);
ChangeVehicleColor(vehid, color1, color2);
OnPropUpdate();
OnPlayerUpdateEx(playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY," You are not in your vehicle.");
return 1;
}
}
else if(strcmp(x_nr,"buy",true) == 0)
{
if(IsAnOwnableCar(idcar))
{
if(PlayerInfo[playerid][pLevel] < 2)
{
SendClientMessage(playerid, COLOR_GREY, "You need to be level 2 to buy a vehicle!");
return 1;
}
if(PlayerInfo[playerid][pPcarkey] == 999) { }
else { SendClientMessage(playerid, COLOR_GREY, " You already own a vehicles"); return 1; }
if(CarInfo[idcar][cOwned]==1)
{
SendClientMessage(playerid, COLOR_GREY, "Someone already owns this car");
return 1;
}
if(GetPlayerCash(playerid) >= CarInfo[idcar][cValue])
{
if(PlayerInfo[playerid][pPcarkey] == 999) { PlayerInfo[playerid][pPcarkey] = idcar; }
else if(PlayerInfo[playerid][pPcarkey2] == 999) { PlayerInfo[playerid][pPcarkey2] = idcar; }
else if(PlayerInfo[playerid][pPcarkey3] == 999) { PlayerInfo[playerid][pPcarkey3] = idcar; }
else { return 1; }
CarInfo[idcar][cOwned] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(CarInfo[idcar][cOwner], sendername, 0, strlen(sendername), 999);
GivePlayerCash(playerid,-CarInfo[idcar][cValue]);
PlayerPlayMusic(playerid);
GameTextForPlayer(playerid, "~w~Congratulations~n~Don't forget to /v park it!", 5000, 3);
SendClientMessage(playerid, COLOR_GRAD2, "Congratulations on your new purchase!");
SendClientMessage(playerid, COLOR_GRAD2, "Type /vehiclehelp to view the vehicle manual!");
DateProp(playerid);
OnPropUpdate();
OnPlayerUpdateEx(playerid);
TogglePlayerControllable(playerid, 1);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You don't have enough cash with you ! ");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "HINT: (/v)ehicle [name]");
SendClientMessage(playerid, COLOR_WHITE, "Available names: park, lock, sell, color, tow, locate");
return 1;
}
}
return 1;
}
else if(strcmp(x_job,"ownablecar",true) == 0)
{
if(OwnableCarOffer[playerid] < 999)
{
if(OwnableCarID[playerid] == 0) { return 1; }
if(OwnableCarPrice[playerid] == 0 || OwnableCarPrice[playerid] > 1500001) { return 1; }
if(OwnableCarID[playerid] == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey]) { }
else if(OwnableCarID[playerid] == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2]) { }
else if(OwnableCarID[playerid] == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey3]) { }
else { SendClientMessage(playerid, COLOR_GREY, " Offer is no longer available"); return 1; }
if(GetPlayerCash(playerid) >= OwnableCarPrice[playerid])
{
if(IsPlayerConnected(OwnableCarOffer[playerid]))
{
GetPlayerName(OwnableCarOffer[playerid], giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerInfo[playerid][pPcarkey] == 999)
{
if(GetPlayerVehicleID(OwnableCarOffer[playerid]) == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey])
{
PlayerInfo[playerid][pPcarkey] = PlayerInfo[OwnableCarOffer[playerid]][pPcarkey];
PlayerInfo[OwnableCarOffer[playerid]][pPcarkey] = 999;
}
else if(GetPlayerVehicleID(OwnableCarOffer[playerid]) == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2])
{
PlayerInfo[playerid][pPcarkey] = PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2];
PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2] = 999;
}
else if(GetPlayerVehicleID(OwnableCarOffer[playerid]) == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey3])
{
PlayerInfo[playerid][pPcarkey] = PlayerInfo[OwnableCarOffer[playerid]][pPcarkey3];
PlayerInfo[OwnableCarOffer[playerid]][pPcarkey3] = 999;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Vehicle seller needs to be at his car !");
return 1;
}
format(string, sizeof(string), "* You bought a car for $%d from %s.",OwnableCarPrice[playerid],giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* %s has bought your car for $%d.",sendername,OwnableCarPrice[playerid]);
SendClientMessage(OwnableCarOffer[playerid], COLOR_WHITE, string);
RemovePlayerFromVehicle(OwnableCarOffer[playerid]);
GivePlayerCash(playerid, - OwnableCarPrice[playerid]);
GivePlayerCash(OwnableCarOffer[playerid], OwnableCarPrice[playerid]);
strmid(CarInfo[OwnableCarID[playerid]][cOwner], sendername, 0, strlen(sendername), 999);
}
else if(PlayerInfo[playerid][pPcarkey2] == 999)
{
if(GetPlayerVehicleID(OwnableCarOffer[playerid]) == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey])
{
PlayerInfo[playerid][pPcarkey2] = PlayerInfo[OwnableCarOffer[playerid]][pPcarkey];
PlayerInfo[OwnableCarOffer[playerid]][pPcarkey] = 999;
}
else if(GetPlayerVehicleID(OwnableCarOffer[playerid]) == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2])
{
PlayerInfo[playerid][pPcarkey2] = PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2];
PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2] = 999;
}
else if(GetPlayerVehicleID(OwnableCarOffer[playerid]) == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey3])
{
PlayerInfo[playerid][pPcarkey2] = PlayerInfo[OwnableCarOffer[playerid]][pPcarkey3];
PlayerInfo[OwnableCarOffer[playerid]][pPcarkey3] = 999;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Vehicle seller needs to be at his car !");
return 1;
}
format(string, sizeof(string), "* You bought a car for $%d from %s.",OwnableCarPrice[playerid],giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* %s has bought your car for $%d.",sendername,OwnableCarPrice[playerid]);
SendClientMessage(OwnableCarOffer[playerid], COLOR_WHITE, string);
RemovePlayerFromVehicle(OwnableCarOffer[playerid]);
GivePlayerCash(playerid, - OwnableCarPrice[playerid]);
GivePlayerCash(OwnableCarOffer[playerid], OwnableCarPrice[playerid]);
strmid(CarInfo[OwnableCarID[playerid]][cOwner], sendername, 0, strlen(sendername), 999);
}
else if(PlayerInfo[playerid][pPcarkey3] == 999)
{
if(GetPlayerVehicleID(OwnableCarOffer[playerid]) == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey])
{
PlayerInfo[playerid][pPcarkey3] = PlayerInfo[OwnableCarOffer[playerid]][pPcarkey];
PlayerInfo[OwnableCarOffer[playerid]][pPcarkey] = 999;
}
else if(GetPlayerVehicleID(OwnableCarOffer[playerid]) == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2])
{
PlayerInfo[playerid][pPcarkey3] = PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2];
PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2] = 999;
}
else if(GetPlayerVehicleID(OwnableCarOffer[playerid]) == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey3])
{
PlayerInfo[playerid][pPcarkey3] = PlayerInfo[OwnableCarOffer[playerid]][pPcarkey3];
PlayerInfo[OwnableCarOffer[playerid]][pPcarkey3] = 999;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Vehicle seller needs to be at his car !");
return 1;
}
format(string, sizeof(string), "* You bought a car for $%d from %s.",OwnableCarPrice[playerid],giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* %s has bought your car for $%d.",sendername,OwnableCarPrice[playerid]);
SendClientMessage(OwnableCarOffer[playerid], COLOR_WHITE, string);
RemovePlayerFromVehicle(OwnableCarOffer[playerid]);
GivePlayerCash(playerid, - OwnableCarPrice[playerid]);
GivePlayerCash(OwnableCarOffer[playerid], OwnableCarPrice[playerid]);
strmid(CarInfo[OwnableCarID[playerid]][cOwner], sendername, 0, strlen(sendername), 999);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You already have 3 cars ! ");
return 1;
}
DateProp(playerid);
DateProp(OwnableCarOffer[playerid]);
OnPropUpdate();
OnPlayerUpdateEx(playerid);
OnPlayerUpdateEx(OwnableCarOffer[playerid]);
OwnableCarOffer[playerid] = 999;
OwnableCarID[playerid] = 0;
OwnableCarPrice[playerid] = 0;
GameTextForPlayer(playerid, "~w~Congratulations~n~Don't forget to /v park it!", 5000, 3);
SendClientMessage(playerid, COLOR_GRAD2, "Congratulations on your new purchase!");
SendClientMessage(playerid, COLOR_GRAD2, "Type /vehiclehelp to view the vehicle manual!");
return 1;
}
else
{