13.01.2013, 17:52
Hello there i have problems with my script..... Its works for carkey1 and 2 but when i try cars with key 3,4,5 its not works its say "You are not in your vehicle". Plz help.
PHP код:
else if(strcmp(x_nr,"paintjob",true) == 0)
{
if(PlayerInfo[playerid][pPcarkey] == 9999 || PlayerInfo[playerid][pPcarkey2] == 9999 || PlayerInfo[playerid][pPcarkey3] == 9999 || PlayerInfo[playerid][pPcarkey4] == 9999 || PlayerInfo[playerid][pPcarkey5] == 9999)
{
SendClientMessage(playerid, COLOR_GREY," You don't have a vehicle to respray.");
return 1;
}
if(!IsAtDealership(playerid) && !IsAtPaySpray(playerid))
{
SendClientMessage(playerid, COLOR_GREY,"* You must be at a Dealership or a Pay'n'Spray to do this!");
return 1;
}
if(GetPlayerMoney(playerid) < 5000)
{
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 paintjob [paintjob(0-3)]");
return 1;
}
new color1;
color1 = strval(tmp);
if(color1 < 0 && color1 > 3)
{
SendClientMessage(playerid, COLOR_GREY, " Wrong Paintjob 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 if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey4])
{
vehid = PlayerInfo[playerid][pPcarkey4];
}
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey5])
{
vehid = PlayerInfo[playerid][pPcarkey5];
}
else if(GetPlayerVehicleID(playerid) != PlayerInfo[playerid][pPcarkey5] || GetPlayerVehicleID(playerid) != PlayerInfo[playerid][pPcarkey4] || GetPlayerVehicleID(playerid) != PlayerInfo[playerid][pPcarkey3] || GetPlayerVehicleID(playerid) != PlayerInfo[playerid][pPcarkey2] || GetPlayerVehicleID(playerid) != PlayerInfo[playerid][pPcarkey])
{
SendClientMessage(playerid, COLOR_GREY," You are not in your vehicle.");
return 1;
}
if(IsPlayerInVehicle(playerid, vehid))
{
CarInfo[vehid][cPaintjob] = color1;
SafeGivePlayerMoney(playerid, -5000);
GameTextForPlayer(playerid, "~w~Bill for a Paint Respray~n~~r~-$5000", 5000, 1);
ChangeVehiclePaintjob(vehid, color1);
OnPropUpdate(4,vehid);
OnPlayerUpdateEx(playerid);
return 1;
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "HINT: (/v)ehicle [name]");
SendClientMessage(playerid, COLOR_WHITE, "Available names: park, lock(1-2), sell, sellto, color, paintjob");
return 1;
}
}
return 1;
}