Engine Script....
#1

So i been trying for a while to make my engine script NOT force BMX/Regular bikes ((Aka - Pedal Bikes)) to have to use /engine....

Anyone can help?

Quote:

CMD:engine(playerid)
{
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, -1, "You need to be the driver of the vehicle");
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
if(engine == 1){
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 0, lights, alarm, doors, bonnet, boot, objective);
format(szMessage, sizeof(szMessage), "* %s Turns the key towards themself turning the engine OFF", szPlayerName);
nearByMessage(playerid, COLOR_PURPLE, szMessage);
}else{
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 1, lights, alarm, doors, bonnet, boot, objective);
format(szMessage, sizeof(szMessage), "* %s Turns the key away from themself turning the engine ON", szPlayerName);
nearByMessage(playerid, COLOR_PURPLE, szMessage);
}
return 1;
}

Reply
#2

pawn Код:
CMD:engine(playerid, params[])
{
    if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        if(!IsBicycle(vehicleid))
        {
            new vehicleid = GetPlayerVehicleID(playerid);
            new engine, lights, alarm, doors, bonnet, boot, objective;
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
            if(engine == 1)
            {
                engine = 0;
                lights = 0;
                SetVehicleParamsEx(vehicleid, 0,0, alarm, doors, bonnet, boot, objective);
                format(szMessage, sizeof(szMessage), "* %s Turns the key towards themself turning the engine OFF", szPlayerName);
                nearByMessage(playerid, COLOR_PURPLE, szMessage);

            }
            else
            {
                engine = 1;
                SetVehicleParamsEx(vehicleid, 1,1, alarm, doors, bonnet, boot, objective);
                format(szMessage, sizeof(szMessage), "* %s Turns the key away from themself turning the engine ON", szPlayerName);
                nearByMessage(playerid, COLOR_PURPLE, szMessage);
            }
        }
    else return SendClientMessage(playerid, -1, "You need to be the driver of the vehicle");
    return 1;
}

stock IsBicycle(vehicleid)
{
    switch(GetVehicleModel(vehicleid))
    {
        case 481,509,510: return 1;
    }
    return 0;
}
Reply
#3

Quote:
Originally Posted by Tayab
Посмотреть сообщение
pawn Код:
CMD:engine(playerid, params[])
{
    if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        if(!IsBicycle(vehicleid))
        {
            new vehicleid = GetPlayerVehicleID(playerid);
            new engine, lights, alarm, doors, bonnet, boot, objective;
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
            if(engine == 1)
            {
                engine = 0;
                lights = 0;
                SetVehicleParamsEx(vehicleid, 0,0, alarm, doors, bonnet, boot, objective);
                format(szMessage, sizeof(szMessage), "* %s Turns the key towards themself turning the engine OFF", szPlayerName);
                nearByMessage(playerid, COLOR_PURPLE, szMessage);

            }
            else
            {
                engine = 1;
                SetVehicleParamsEx(vehicleid, 1,1, alarm, doors, bonnet, boot, objective);
                format(szMessage, sizeof(szMessage), "* %s Turns the key away from themself turning the engine ON", szPlayerName);
                nearByMessage(playerid, COLOR_PURPLE, szMessage);
            }
        }
    else return SendClientMessage(playerid, -1, "You need to be the driver of the vehicle");
    return 1;
}

stock IsBicycle(vehicleid)
{
    switch(GetVehicleModel(vehicleid))
    {
        case 481,509,510: return 1;
    }
    return 0;
}
Small issue.... The defines and code you posted is no where near what anything used on this script meaning i got this once i put it in there...



(621) : error 017: undefined symbol "initiateConnections"
(1069) : error 017: undefined symbol "nearByMessage"
1386) : error 017: undefined symbol "resetPlayerVariables"
(1397) : error 017: undefined symbol "syncPlayerTime"
(2163) : error 017: undefined symbol "adminLog"
(2990) : error 017: undefined symbol "SpawnPlayerVehicle"
(3091) : error 017: undefined symbol "adminLog"
(3562) : error 017: undefined symbol "getPlayerHouseID"
(3954) : error 017: undefined symbol "SpawnPlayerVehicle"
(4843) : error 017: undefined symbol "syncPlayerTime"
(5031) : error 017: undefined symbol "nearByMessage"
(5146) : error 017: undefined symbol "IsPlayerAimingAtPlayer"
(5605) : error 017: undefined symbol "DestroyPlayerVehicle"
(5641) : error 017: undefined symbol "IsBicycle"
(5643) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
(5652) : error 017: undefined symbol "nearByMessage"
(5660) : error 017: undefined symbol "nearByMessage"
(5640) : warning 204: symbol is assigned a value that is never used: "vehicleid"
(5667) : error 029: invalid expression, assumed zero
(5667) : error 017: undefined symbol "cmd_lights"
(5667) : error 029: invalid expression, assumed zero
(5667) : fatal error 107: too many error messages on one line[/QUOTE]


NOTE: This is NOT an NGRP/God Father or any public script edit.... So don't paste anything from scripts cause it wont work.... It will cause the pawno to flip out like above....

Sorry to sound snotty but it's true....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)