[HELP] Car System With Textdraw
#3

Here is, took from my old CNR gamemode:

Top of script:

pawn Код:
new bool:LockVeh[MAX_PLAYERS];
OnPlayerStateChange:

pawn Код:
if(newstate == 2)
    {
        if(LockVeh[playerid] == true)
        {
        GameTextForPlayer(playerid, "~g~Vehicle Unlocked. Use /lock to lock it.", 5000, 5);
        SendClientMessage(playerid,yellow,"Vehicle unlocked.Use /lock to lock it.");
        LockVeh[playerid] = false;
}
The command:

pawn Код:
CMD:lock(playerid, params[])
{
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFFFFFFAA,"You have to be inside a vehicle.");
    if(PlayerInfo[playerid][pJailed] == 1) return SendClientMessage(playerid, red, "You cannot use this command in jail.");

    if(LockVeh[playerid] == false)
    {
        GameTextForPlayer(playerid, "~r~Vehicle Locked. Use again /lock to unlock it.", 5000, 5);
        SendClientMessage(playerid,yellow,"Vehicle locked.Use again /lock to unlock it.");
        RemovePlayerFromVehicle(playerid);
        LockVeh[playerid] = true;
        for(new i=0; i < MAX_PLAYERS; i++)
        {
            if(i == playerid) continue;
            {
                SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,0,1);
            }
        }
    }
    else
    {
        GameTextForPlayer(playerid, "~g~Vehicle Unlocked. Use /lock to lock it.", 5000, 5);
        SendClientMessage(playerid,yellow,"Vehicle unlocked.Use /lock to lock it.");
        LockVeh[playerid] = false;
        for(new i=0; i < MAX_PLAYERS; i++)
        {
            if(i == playerid) continue;
            {
                SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,0,0);
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
[HELP] Car System With Textdraw - by huydollar - 12.02.2014, 12:32
Re: [HELP] Car System With Textdraw - by zT KiNgKoNg - 12.02.2014, 12:35
Re: [HELP] Car System With Textdraw - by Face9000 - 12.02.2014, 13:59

Forum Jump:


Users browsing this thread: 1 Guest(s)