09.06.2009, 22:33
okay i have taxis extreme vehicle management
But i change the menu into /buy /park /sell etc but it keeps doing this ..
in the middle of the script making it so if i do ANY command (except rcon) it says : you must own a vehicle first!
Heres some of my codes.
NOTE : I took the stock_buycar etc codes and made them into commands
If somebody has the old taxi vehicle management without the menus but Commands please send it to me..
NOTE #2 : Under return SendClientMessage etc it used to say return 1;
But i change the menu into /buy /park /sell etc but it keeps doing this ..
Код:
return 1;
Heres some of my codes.
NOTE : I took the stock_buycar etc codes and made them into commands
If somebody has the old taxi vehicle management without the menus but Commands please send it to me..
NOTE #2 : Under return SendClientMessage etc it used to say return 1;
Код:
if(strcmp(cmd, "/buy", true) == 0)
{
new string[256];
if(passenger[playerid] == 1) {
return SendClientMessage(playerid, COLOR_BRIGHTRED, "You must be in the drivers' seat of this vehicle to buy it!");
}
if(IsPlayerInAnyVehicle(playerid) == 0) {
return SendClientMessage(playerid, COLOR_BRIGHTRED, "You must be in a vehicle in order to buy one!");
}
if(VehicleInfo[GetPlayerVehicleID(playerid)][buybar] == 1) {
return SendClientMessage(playerid, COLOR_BRIGHTRED, "This vehicle is currently set as un-buyable!");
}
if (strcmp(VehicleInfo[GetPlayerVehicleID(playerid)][owner],PlInfo[playerid][name],false) == 0) {
format(string, sizeof(string), "You already own this %s, %s", VehicleInfo[GetPlayerVehicleID(playerid)][name], PlInfo[playerid][name]);
return SendClientMessage(playerid, COLOR_BRIGHTRED, string);
}
if(VehicleInfo[GetPlayerVehicleID(playerid)][bought] == 1) {
format(string, sizeof(string), "This %s is owned by %s, and is not for sale!", VehicleInfo[GetPlayerVehicleID(playerid)][name], VehicleInfo[GetPlayerVehicleID(playerid)][owner]);
return SendClientMessage(playerid, COLOR_BRIGHTRED, string);
}
if(PlInfo[playerid][vowner] == 1) {
return SendClientMessage(playerid, COLOR_BRIGHTRED, "You can only own ONE vehicle at a time! You must sell your other vehicle first!");
}
new cash[MAX_PLAYERS];
cash[playerid] = CallRemoteFunction("GetPlayerTcash","i",playerid);
if(cash[playerid] >= VehicleInfo[GetPlayerVehicleID(playerid)][vehiclecost]) {
new stringa[256];
strmid(VehicleInfo[GetPlayerVehicleID(playerid)][owner], PlInfo[playerid][name], 0, strlen(PlInfo[playerid][name]), 255);
VehicleInfo[GetPlayerVehicleID(playerid)][bought] = 1;
PlInfo[playerid][vowner] = 1;
PlInfo[playerid][vowned] = GetPlayerVehicleID(playerid);
CallRemoteFunction("GivePlayerTcash","ii",playerid,-VehicleInfo[GetPlayerVehicleID(playerid)][vehiclecost]);
SavePlayer(playerid);
format(stringa, sizeof(stringa), "You just bought this %s for %d tcash. Your %s currently has %d/100 of its fuel remaining!", VehicleInfo[GetPlayerVehicleID(playerid)][name], VehicleInfo[GetPlayerVehicleID(playerid)][vehiclecost],VehicleInfo[GetPlayerVehicleID(playerid)][name],Gas[GetPlayerVehicleID(playerid)]);
return SendClientMessage(playerid, COLOR_GREEN, stringa);
}
if(cash[playerid] < VehicleInfo[GetPlayerVehicleID(playerid)][vehiclecost]) {
new string6[256];
format(string6, sizeof(string6), "You do not have %d tcash and cannot afford this %s!", VehicleInfo[GetPlayerVehicleID(playerid)][vehiclecost],VehicleInfo[GetPlayerVehicleID(playerid)][name]);
return SendClientMessage(playerid, COLOR_BRIGHTRED, string6);
}
return 1;
}
if(strcmp(cmd, "/sell", true) == 0) {
new string[256];
if(passenger[playerid] == 1) {
return SendClientMessage(playerid, COLOR_BRIGHTRED, "You must be in the drivers' seat of your vehicle to sell it!");
}
if(IsPlayerInAnyVehicle(playerid) == 0) {
return SendClientMessage(playerid, COLOR_BRIGHTRED, "You must be inside your vehicle in order to sell it");
}
new vehicleID = GetPlayerVehicleID(playerid);
if (strcmp(VehicleInfo[vehicleID][owner],PlInfo[playerid][name],false) == 0) {
SetVehicleToRespawn(vehicleID);
SetVehicleVirtualWorld(vehicleID,10);
SetTimerEx("RestartVehicle",5000,0,"i",vehicleID);
PlInfo[playerid][vowned] = 0;
PlInfo[playerid][vowner] = 0;
strmid(VehicleInfo[vehicleID][owner], DEFAULT_OWNER, 0, strlen(DEFAULT_OWNER), 255);
VehicleInfo[vehicleID][bought] = 0;
VehicleInfo[vehicleID][secure] = 0;
CallRemoteFunction("GivePlayerTcash","ii",playerid,VehicleInfo[vehicleID][vehiclecost]);
format(string, sizeof(string), "You just sold your %s for %d tcash", VehicleInfo[vehicleID][name], VehicleInfo[vehicleID][vehiclecost]);
SendClientMessage(playerid, COLOR_BRIGHTRED, string);
SavePlayer(playerid);
}
else
return SendClientMessage(playerid, COLOR_BRIGHTRED, "[ ! ]You don't own this vehicle!");
}
{
if(VehicleInfo[GetPlayerVehicleID(playerid)][buybar] == 1) {
return SendClientMessage(playerid, COLOR_BRIGHTRED, "This vehicle is un-buyable and these features will not work!");
}
if(PlInfo[playerid][vowner] == 0) {
return SendClientMessage(playerid, COLOR_BRIGHTRED, "You must first own a vehicle before you can use this feature!");
}
return 1;
if(strcmp(cmd, "/park", true) == 0) {
if(IsPlayerInAnyVehicle(playerid)) {
if (strcmp(VehicleInfo[GetPlayerVehicleID(playerid)][owner],PlInfo[playerid][name],false) == 0) {
new Float:spx,Float:spy,Float:spz;
new Float:spa;
GetVehiclePos(GetPlayerVehicleID(playerid),spx,spy,spz);
GetVehicleZAngle(GetPlayerVehicleID(playerid),spa);
VehicleInfo[GetPlayerVehicleID(playerid)][x_spawn] = spx;
VehicleInfo[GetPlayerVehicleID(playerid)][y_spawn] = spy;
VehicleInfo[GetPlayerVehicleID(playerid)][z_spawn] = spz;
VehicleInfo[GetPlayerVehicleID(playerid)][za_spawn] = spa;
format(securemess,sizeof(securemess),"You have just parked your %s at your current location...it will respawn here in the future!", VehicleInfo[GetPlayerVehicleID(playerid)][name]);
return SendClientMessage(playerid, COLOR_GREEN, securemess);
}
else
return SendClientMessage(playerid, COLOR_BRIGHTRED, "You do not own this vehicle and cannot park it!");
}
}
else
return SendClientMessage(playerid, COLOR_BRIGHTRED, "You must be in a vehicle to use this feature");
}
return 1;

