SA-MP Forums Archive
Help with vehicles lock - 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: Help with vehicles lock (/showthread.php?tid=357487)



Help with vehicles lock - Tuntun - 07.07.2012

hello
i want a car vehicles /lock and /unlock cmd's for lock and unlock car.....
please help me....


Re: Help with vehicles lock - Dubya - 07.07.2012

pawn Код:
if(!strcmp(cmdtext,"/lock",true))
    {
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFFFFFFAA,"You have to be inside a vehicle.");
        for(new i=0; i < MAX_PLAYERS; i++)
        {
            if(i == playerid) continue;
            SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,0,1);
        }
        return 1;
    }
pawn Код:
if(!strcmp(cmdtext,"/unlock",true))
    {
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFFFFFFAA,"You have to be inside a vehicle.");
        for(new i=0; i < MAX_PLAYERS; i++)
        {
            if(i == playerid) continue;
            SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,0,0);
        }
        return 1;
    }



Re: Help with vehicles lock - Tuntun - 07.07.2012

Quote:
Originally Posted by Dubya
Посмотреть сообщение
pawn Код:
if(!strcmp(cmdtext,"/lock",true))
    {
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFFFFFFAA,"You have to be inside a vehicle.");
        for(new i=0; i < MAX_PLAYERS; i++)
        {
            if(i == playerid) continue;
            SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,0,1);
        }
        return 1;
    }
pawn Код:
if(!strcmp(cmdtext,"/unlock",true))
    {
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFFFFFFAA,"You have to be inside a vehicle.");
        for(new i=0; i < MAX_PLAYERS; i++)
        {
            if(i == playerid) continue;
            SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,0,0);
        }
        return 1;
    }
i get you are script but i got error's please fix it
Код:
:\pilot.pwn(8878) : warning 217: loose indentation
E:\pilot.pwn(8878) : error 017: undefined symbol "cmdtext"
E:\pilot.pwn(8880) : error 017: undefined symbol "playerid"
E:\pilot.pwn(8880) : error 017: undefined symbol "playerid"
E:\pilot.pwn(8883) : error 017: undefined symbol "playerid"
E:\pilot.pwn(8884) : error 017: undefined symbol "playerid"
E:\pilot.pwn(8888) : warning 217: loose indentation
E:\pilot.pwn(8888) : error 017: undefined symbol "cmdtext"
E:\pilot.pwn(8890) : error 017: undefined symbol "playerid"
E:\pilot.pwn(8890) : error 017: undefined symbol "playerid"
E:\pilot.pwn(8893) : error 017: undefined symbol "playerid"
E:\pilot.pwn(8894) : error 017: undefined symbol "playerid"
E:\pilot.pwn(8898) : warning 209: function "LoadObjects" should return a value
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


10 Errors.



Re: Help with vehicles lock - LaGrande - 07.07.2012

place it under OnPlayerCommandText, to kill the errors


Re: Help with vehicles lock - Tuntun - 07.07.2012

Can You Fix it??Please.