Help with vehicles lock
#1

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

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;
    }
Reply
#3

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.
Reply
#4

place it under OnPlayerCommandText, to kill the errors
Reply
#5

Can You Fix it??Please.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)