Easy question!
#1

Well, I wonder what's the 2 represented...

pawn Код:
if(newkeys & KEY_SUBMISSION)
    {
        if(GetPlayerState(playerid) == 2)
        {
            SetVehicleHealth(GetPlayerVehicleID(playerid), 1000);
            RepairVehicle(GetPlayerVehicleID(playerid));
            GameTextForPlayer(playerid, "Vehicle Fixed", 2000, 6);
            PlayerPlaySound(playerid, 1133, 0, 0, 10);
        }
    }
pawn Код:
if(newkeys & KEY_FIRE)
    {
        if(GetPlayerState(playerid) == ) //What to put here?
        {
            AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
            PlayerPlaySound(playerid, 1133, 0, 0, 10);
        }
    }
Reply
#2

One of these
https://sampwiki.blast.hk/wiki/Playerstates
Reply
#3

Player states are represented as an integer. You can find a list of them here:

https://sampwiki.blast.hk/wiki/Playerstates

According to that article, the code is looking to see if the player is the driver of any vehicle.
Reply
#4

https://sampwiki.blast.hk/wiki/Playerstates
Reply
#5

Thanks, dusk.
Reply
#6

Quote:
Originally Posted by LeeXian99
Посмотреть сообщение
Well, I wonder what's the 2 represented...

pawn Код:
if(newkeys & KEY_SUBMISSION)
    {
        if(GetPlayerState(playerid) == 2)
        {
            SetVehicleHealth(GetPlayerVehicleID(playerid), 1000);
            RepairVehicle(GetPlayerVehicleID(playerid));
            GameTextForPlayer(playerid, "Vehicle Fixed", 2000, 6);
            PlayerPlaySound(playerid, 1133, 0, 0, 10);
        }
    }
pawn Код:
if(newkeys & KEY_FIRE)
    {
        if(GetPlayerState(playerid) == ) //What to put here?
        {
            AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
            PlayerPlaySound(playerid, 1133, 0, 0, 10);
        }
    }
For the 1st one, if you press 2 in a vehicle, your vehicle will get fixed (2 can be of Numpad also)

For the 2nd one, if you press Left Alt, a Nitro will be added to your vehicle, only if you are in a vehicle.

For those both codes, you need to be in a vehicle of them to work

Or, it just represents https://sampwiki.blast.hk/wiki/Playerstates
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)