Help with my engine system
#1

PHP код:
CMD:engine(playerid,params[])
{
    for(new 
xGetPlayerVehicleID(playerid); x++)
    {
        if(
vehicleVariables[x][vEngine] == 0)
        {
            new 
vid GetPlayerVehicleID(playerid);
            new 
engine,lights,alarm,doors,bonnet,boot,objective;
            
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
            
SetVehicleParamsEx(vid,1,lights,alarm,doors,bonnet,boot,objective);
            
timer69 SetTimer("fueltimer",20000,true);
            
vehicleVariables[x][vEngine] = 1;
               new 
str[128],pName[MAX_PLAYER_NAME];
            
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
            
format(str,sizeof(str),"%s turns the key of the engine to start the vehicle.",pName);
            
nearByMessage(playeridCOLOR_PURPLEstr5.0);
        }
        else if(
vehicleVariables[x][vEngine] == 1)
        {
            new 
vid GetPlayerVehicleID(playerid),str[128],pName[MAX_PLAYER_NAME];
            new 
engine,lights,alarm,doors,bonnet,boot,objective;
            
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
            
SetVehicleParamsEx(vid,0,lights,alarm,doors,bonnet,boot,objective);
            
KillTimer(timer69);
            
vehicleVariables[x][vEngine] = 0;
            
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
            
format(str,sizeof(str),"%s turns the key of the engine to stop the vehicle.",pName);
            
nearByMessage(playeridCOLOR_PURPLEstr5.0);
        }
        else if(
vehicleVariables[x][vFuel] == 0)
        {
            
SendClientMessage(playerid,COLOR_WHITE,"Vehicle is out of fuel.");
        }
    }
    return 
1;

Reply


Messages In This Thread
Help with my engine system - by Azzeto - 07.12.2011, 22:36
Re: Help with my engine system - by iNorton - 07.12.2011, 22:38
Re: Help with my engine system - by Azzeto - 07.12.2011, 22:40
Re: Help with my engine system - by Steven82 - 07.12.2011, 23:57
Re: Help with my engine system - by Azzeto - 08.12.2011, 00:09

Forum Jump:


Users browsing this thread: 3 Guest(s)