SA-MP Forums Archive
Engine command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Engine command (/showthread.php?tid=527255)



Engine command - Psyhophatic - 21.07.2014

pawn Код:
// out of script
new bool:VehEngine[MAX_VEHICLES];
//....
public OnVehicleSpawn(vehicleid)
{
    VehEngine[vehicleid] = false;
    return 1;
}
//....
CMD:engine(playerid,params[])
{
    new vehid = GetPlayerVehicleID(playerid);
    new engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(vehid, engine, lights, alarm, doors, bonnet, boot, objective);
    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER || GetPlayerState(playerid) != PLAYER_STATE_PASSENGER) return SendClientMessage(playerid,COLOR_GREY,"You must be inside a car !");
    if(VehEngine[vehid] == 0)//7184
    {
        SendClientMessage(playerid, COLOR_YELLOW, "You have turned your engine on.");
        VehEngine[vehid] = 1, SetVehicleParamsEx(vehid, 1, lights, alarm, doors, bonnet, boot, objective);//7187
        return 1;
    }
    if(VehEngine[vehid] == 1)//7190
    {
        SendClientMessage(playerid, COLOR_YELLOW, "You have turned your engine off.");
        VehEngine[vehid] = 0, SetVehicleParamsEx(vehid, 0, lights, alarm, doors, bonnet, boot, objective);//7193
        return 1;
    }
    return 1;
}
pawn Код:
D:\SAMP 0.3z\gamemodes\GM_X.pwn(7184) : warning 213: tag mismatch
D:\SAMP 0.3z\gamemodes\GM_X.pwn(7187) : warning 213: tag mismatch
D:\SAMP 0.3z\gamemodes\GM_X.pwn(7190) : warning 213: tag mismatch
D:\SAMP 0.3z\gamemodes\GM_X.pwn(7193) : warning 213: tag mismatch
What the hell is wrong ?


Re: Engine command - PrivatioBoni - 21.07.2014

It's a Boolean so it's only 'true/false' and can't be a number.


Re: Engine command - Psyhophatic - 21.07.2014

aaa.... I'm so noobie