SA-MP Forums Archive
VAlarm CMD Issue - 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: VAlarm CMD Issue (/showthread.php?tid=395697)



VAlarm CMD Issue - UnknownGamer - 27.11.2012

pawn Код:
if(strcmp(cmd, "/valarm", true) == 0)
    {
        if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_GREY, "You need to be the vehicle driver, to open the hood!");
        new vehicleid = GetPlayerVehicleID(playerid);
        new vkey = PlayerInfo[playerid][pPcarkey];
        new vkey2 = PlayerInfo[playerid][pPcarkey2];
        if (valarm == 1 && vehicleid == vkey || vehicleid == vkey2)
        {
            new e,l,a,d,b,bo,o;
            GetVehicleParamsEx(vehicleid,e,l,a,d,b,bo,o);
            SetVehicleParamsEx(vehicleid,e,l,0,d,b,bo,o);
            valarm = 0;
            OnPropUpdate(4,vehicleid);
            return 1;
        }
        else if (valarm == 0 && vehicleid == vkey || vehicleid == vkey2)
        {
            new e,l,a,d,b,bo,o;
            GetVehicleParamsEx(vehicleid,e,l,a,d,b,bo,o);
            SetVehicleParamsEx(vehicleid,e,l,1,d,b,bo,o);
            valarm = 1;
            OnPropUpdate(4,vehicleid);
            return 1;
        }
        return 1;
    }
Anybody spot the issue their?

That only works with my Vehicle ID-1? 2 Doesn't work?