Help with /engine command. -
Azzeto - 07.10.2011
pawn Код:
CMD:engine(playerid,params[]){
new engine,lights,alarm,doors,bonnet,boot,objective,vid;
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,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,bonnet,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\gangwar.pwn(590) : error 010: invalid function or declaration
C:\Documents and Settings\Customer\Desktop\GameMode\gamemodes\gangwar.pwn(596) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.
PLEASE WHEN YOU ANSWER EXPLAIN THE THINGS SO I CAN LEARN. thanks.
Re: Help with /engine command. -
Mr. Random - 07.10.2011
pawn Код:
CMD:engine(playerid,params[])
{
new RandomStart;
RandomStart = random(4);
switch(RandomStart)
{
case 0,1,2:
{
GetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,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,vid;
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,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,bonnet,boot,objective);
SetVehicleParamsEx(vid,0,lights,alarm,doors,bonnet,boot,objective);
SendClientMessage(playerid,COLOR_CARROT,"You've turned your engine off.");
}
return 1;
}
Re: Help with /engine command. -
Azzeto - 07.10.2011
I dont need it like that, I just need it simple, /engine turns it on, then /engine again turns it off.