PDA

View Full Version : Help with /engine command.


Azzeto
07/10/2011, 09:02 AM
CMD:engine(playerid,params[]){
new engine,lights,alarm,doors,bonnet,boot,objective,vi d;
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,1,lights,alarm,doors,bonnet ,boot,objective);
SendClientMessage(playerid,COLOR_CARROT,"You've turned your engine on.");
}
if
{
GetVehicleParamsEx(vid,1,lights,alarm,doors,bonnet ,boot,objective);
SetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SendClientMessage(playerid,COLOR_CARROT,"You've turned your engine off.");
}
return 1;
}

and I get these
C:\Documents and Settings\Customer\Desktop\GameMode\gamemodes\gangw ar.pwn(590) : error 010: invalid function or declaration
C:\Documents and Settings\Customer\Desktop\GameMode\gamemodes\gangw ar.pwn(596) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.


PLEASE WHEN YOU ANSWER EXPLAIN THE THINGS SO I CAN LEARN. thanks.

Mr. Random
07/10/2011, 09:09 AM
CMD:engine(playerid,params[])
{
new RandomStart;
RandomStart = random(4);
switch(RandomStart)
{
case 0,1,2:
{
GetVehicleParamsEx(GetPlayerVehicleID(playerid),en gine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(GetPlayerVehicleID(playerid),1, 1,alarm,doors,bonnet,boot,objective);
}
case 3:
{
//Type here what happens incase engine fail to start
}
}
return 1;
}

I made it into a random of 4.
With fixing your version :

CMD:engine(playerid,params[])
{
new engine,lights,alarm,doors,bonnet,boot,objective,vi d;
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,1,lights,alarm,doors,bonnet ,boot,objective);
SendClientMessage(playerid,COLOR_CARROT,"You've turned your engine on.");
} // ---> ??
if // --> ??
{
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,0,lights,alarm,doors,bonnet ,boot,objective);
SendClientMessage(playerid,COLOR_CARROT,"You've turned your engine off.");
}
return 1;
}

Azzeto
07/10/2011, 09:10 AM
I dont need it like that, I just need it simple, /engine turns it on, then /engine again turns it off.