SA-MP Forums Archive
Car lock help - 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: Car lock help (/showthread.php?tid=285133)



Car lock help - [COD5]dustyn[RAB] - 22.09.2011

I scripted a training server for my clan. A nice one too. But at clan wars on cod5 ressurection we need to fight on foot. In my clan server I have many airal vehicles. I need a command to lock all hunters,sparrows,rustlers, or remove players from them when they get in, so my clan will learn to fight on foot more. I also need a command to unlock them.

I have never tried using lock functions and would have no idea how to do this. Any help would be apreciated.


Re: Car lock help - BlackStones - 22.09.2011

pawn Код:
dcmd_lockcar(playerid,params[]) {
    #pragma unused params
    if(PlayerInfo[playerid][Level] >= 2) {
        if(IsPlayerInAnyVehicle(playerid)) {
            for(new i = 0; i < MAX_PLAYERS; i++) SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,false,true);
            CMDMessageToAdmins(playerid,"LOCKCAR");
            PlayerInfo[playerid][DoorsLocked] = 1;
            new string[128]; format(string,sizeof(string),"Administrator \"%s\" has locked his car", pName(playerid));
            return SendClientMessageToAll(blue,string);
        } else return SendClientMessage(playerid,red,"ERROR: You need to be in a vehicle to lock the doors");
    } else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}



Re: Car lock help - [COD5]dustyn[RAB] - 22.09.2011

Thanks. but not exactly what im looking for. Thats a command for admins to lock their cars. I need a command to lock and unlock all hydras, hunters, sparrows, and rustlers.


Re: Car lock help - BlackStones - 22.09.2011

this will help you
https://sampwiki.blast.hk/wiki/SetVehicleParamsForPlayer
if i helped you do this: