PDA

View Full Version : Gang Vehicle and Other trouble!


sagoza
16/04/2014, 04:50 PM
Iam making some HQ's for gang's and iam having trouble on the code that stops normal non gang players from driving a organization vehicle...

of all vehicle id's they say the message "[{FF0000}Gangue{FFFFFF}]: Não és dos {006600}Groove{FFFFFF}!"
either the ones belonging to Los Vagos, and the Groove and PSP...

i would like some help on this urgent!


if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
{
if (vehicle == 93 || 94) // LOS VAGOS VEHICLES || 94 || 95 || 96 || 97 || 98 || 99 || 100 || 101
{
if ((GetPVarInt(playerid, "pgangue")) == Groove)
{
SetVehicleParamsEx(vehicle,1,lights,alarm,doors,bo nnet,boot,objective);
return 1;
}
else
{
SendClientMessage(playerid, -1, "[{FF0000}Gangue{FFFFFF}]: Não és dos {006600}Groove{FFFFFF}!");
SetVehicleParamsEx(vehicle,0,lights,alarm,doors,bo nnet,boot,objective);
return 1;
}
}
else if (vehicle == 84 || 85) // LOS VAGOS VEHICLES || 85 || 86 || 87 || 88 || 89 || 90 || 91 || 92
{
if ((GetPVarInt(playerid, "pgangue")) == Los_Vagos)
{
SetVehicleParamsEx(vehicle,1,lights,alarm,doors,bo nnet,boot,objective);
return 1;
}
else
{
SendClientMessage(playerid, -1, "[{FF0000}Gangue{FFFFFF}]: Não és dos {FFFF00}Los Vagos{FFFFFF}!");
SetVehicleParamsEx(vehicle,0,lights,alarm,doors,bo nnet,boot,objective);
return 1;
}
}
else if ((GetVehicleModel(vehicle)) == 596) // PSP VEHICLEs || 427 || 523 || 601 || 497
{
if ((GetPVarInt(playerid, "porgani")) == PSP)
{
SetVehicleParamsEx(vehicle,1,lights,alarm,doors,bo nnet,boot,objective);
return 1;
}
else
{
SetVehicleParamsEx(vehicle,0,lights,alarm,doors,bo nnet,boot,objective);
SendClientMessage(playerid, -1, "[{33FF99}Organização{FFFFFF}]: Não és da {0000FF}PSP{FFFFFF}!");
return 1;
}
}


Any advice is welcome, and it will allways be!

Riddick94
16/04/2014, 04:55 PM
if (vehicle == 93 || 94)

change to:
if (vehicle == 93 || vehicle == 94)

If statement doesn't know what 94 for means, it needs assigned local variable before. Do the same to the rest of your code. And next time, please upload your code to pastebin (if its really long, like this one).

sagoza
16/04/2014, 05:01 PM
Thanks, will do!