//other code
else if(vehicle == 516)
{
for(new iv; iv<MAX_VEHICLES; iv++)// a loop that goes though all vehicles
{
if(gTeam[playerid] == TEAM_BANDIT)
{
if(stolenveh[iv] == 0)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "U stole a Drivers car, be carefull!");
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 1);
new string[128];
format(string,sizeof(string),"%s has stolen a drivers car!",playerid);
SendClientMessageToAllCops(string);
stolenveh[iv] = 1;
return 1;
}
else if(stolenveh[iv] == 1)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "This vehicle has been stolen!");
}
}
}
}//other code
if(gTeam[playerid] == TEAM_BANDIT)
{
if(stolenveh[GetPlayerVehicleID(playerid)] == 0)
{
//Do vehicle stolen stuff
}
else if(stolenveh[GetPlayerVehcileID(playerid)] == 1)
{
//Do Other Vehicle Stolen Stuff
}
}
new iv=1; iv<MAX_VEHICLES; iv++//There's no vehicleid 0
|
Hi Knackworst,
If I understand your code correctlly... You may be able to just do this: pawn Код:
TJ |
if(gTeam[playerid] == TEAM_BANDIT)
{
if(stolenveh[GetPlayerVehicleID(playerid)] == 0)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "U stole a Drivers car, be carefull!");
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 1);
new string[128];
format(string,sizeof(string),"%s has stolen a drivers car!",playerid);
SendClientMessageToAllCops(string);
stolenveh[iv] = 1;
return 1;
}
else if(stolenveh[GetPlayerVehcileID(playerid)] == 1) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "This vehicle has been stolen!");
}
if(gTeam[playerid] == TEAM_BANDIT)
{
if(stolenveh[GetPlayerVehicleID(playerid)] == 0)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "U stole a Drivers car, be carefull!");
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 1);
new string[128];
format(string,sizeof(string),"%s has stolen a drivers car!",playerid);
SendClientMessageToAllCops(string);
stolenveh[iv] = 1;
return 1;
}
else return SendClientMessage(playerid, COLOR_LIGHTBLUE, "This vehicle has been stolen!");
}
else if(vehicle == 516)
{
for(new iv; iv<MAX_VEHICLES; iv++)// a loop that goes though all vehicles
{
if(gTeam[playerid] == TEAM_BANDIT)
{
if(stolenveh[iv] == 1) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "This vehicle has been stolen!");
if(stolenveh[iv] == 0)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "U stole a Drivers car, be carefull!");
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 1);
new string[128];
format(string,sizeof(string),"%s has stolen a drivers car!",playerid);
SendClientMessageToAllCops(string);
stolenveh[iv] = 1;
return 1;
}
}
}
}//other code