Engine command gone wrong :O
#1

Simply, the damn thing can't tell whether the car is a factioncar or an ownable car. (FactionCar = faction, CInfo = ownable)

Please help?

pawn Код:
if(strcmp(cmd, "/engine", true) == 0)
{
new carid = GetPlayerVehicleID(playerid);
if(!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_RED, "You aren't in a vehicle!");
return 1;
}
if(CInfo[carid-1][cEngine] == 0)
{
OnPlayerCommandText(playerid, "/me spins the key and successfully starts the engine");
TogglePlayerControllable(playerid, 1);
CInfo[carid-1][cEngine] = 1;
return 1;
}
if(CInfo[carid-1][cEngine] == 0)
{
OnPlayerCommandText(playerid, "/me spins the key and shuts off the engine");
TogglePlayerControllable(playerid, 0);
CInfo[carid-1][cEngine] = 0;
return 1;
}
if(FactionCar[carid][fcFaction] != PlayerInfo[playerid][pFaction])
{
OnPlayerCommandText(playerid, "/me tries to start the engine, but fails");
SendClientMessage(playerid, COLOR_GREY, "You don't have the keys for this vehicle!");
return 1;
}
if(FactionCar[carid][fcEngine] == 0)
{
OnPlayerCommandText(playerid, "/me spins the key and successfully starts the engine");
TogglePlayerControllable(playerid, 1);
FactionCar[carid][fcEngine] = 1;
return 1;
}
if(FactionCar[carid][fcEngine] == 1)
{
OnPlayerCommandText(playerid, "/me spins the key and shuts off the engine");
TogglePlayerControllable(playerid, 0);
FactionCar[carid][fcEngine] = 0;
}
return 1;
}
Reply
#2

Yeah, help please
Reply
#3

Damn Antonio .... You get into this big as stupid fight with Dan, Split off, and now you cant even manage to figure your own shit out...

Here .. ILL feel sorry for ya and point you in the right direction.

1) You should have stuck with a community that had someone that could build

2) You should have fired the 'Cheerleader Squad that follows you around believing you can actually do what you claim.

3) You 'If Statment' has multi results because your using if statements and not 'else if'

Example:
Код:
if(YouWasntA[Idiot]==VAR){
// result ( You Wouldnt struggle
} else if(YouCouldScript[basic]==VAR) {
//result You wouldnt be here asking
} else {
// You really wouldn't be relying on everyone else to do for you
}
Reply
#4

Dont comment if your not gonna help
Reply
#5

believe it or not ...

the 'Code' post shows the solution to your problem ...

However, a little Further Advice, as my grandfather once told me...

Dont ask a Question if your not going to be satisfied with the answer!
Reply
#6

Atcually, It didnt, it always says "You don't have the keys for this vehicle!"
Reply
#7

and again, its because of the 50 IF(THIS) statments ..

your if(CHECKS) ...the 'CHECKS' are your problem

Hell, you managed to get a copy of my Core, look through it and use it as an example.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)