How to make this only for V.I.P ?
#3

Do you have any VIP variables?

If not lets make some.

pawn Код:
new pVIP[MAX_PLAYERS]; // Goes on top of script, under defines. Creates the variable and gets it ready for ID storing.
pawn Код:
//Ill be making a basic command using ZCMD to give me vip.


CMD:givemevip(playerid, params[])
{
    pVIP[playerid] = 1; // Sets pVIP Variable to one for the playerid. (Person typing command.)
    SendClientMessage(playerid, -1, "You have given yourself vip."); // Gives the player a simple message.
    return 1;
}
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(pVIP[playerid] == 1) // If the player is pVIP == 1.
    {
   
        if(newkeys & KEY_FIRE)
        {
            if (IsPlayerInAnyVehicle(playerid))
            {
                new Float:vx,Float:vy,Float:vz;
                GetVehicleVelocity(GetPlayerVehicleID(playerid),vx,vy,vz);
                SetVehicleVelocity(GetPlayerVehicleID(playerid), vx*1.5, vy*1.5, vz*1.5);

            }
        }
        if(newkeys == KEY_SUBMISSION)
         {
            if(IsPlayerInAnyVehicle(playerid))
            {
                SetVehicleHealth(GetPlayerVehicleID(playerid),1000.0);
                RepairVehicle(GetPlayerVehicleID(playerid));
            }
        }
        if(newkeys & KEY_CROUCH)
        {
            if (IsPlayerInAnyVehicle(playerid))
            {
                new Float:x, Float:y, Float:z;
                GetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z);
                SetVehicleVelocity(GetPlayerVehicleID(playerid) ,x ,y ,z+0.3);
            }
        }
        if(newkeys & KEY_HANDBRAKE)
        {
            if (IsPlayerInAnyVehicle(playerid))
            {
                new Float:vx,Float:vy,Float:vz;
                GetVehicleVelocity(GetPlayerVehicleID(playerid),vx,vy,vz);
                SetVehicleVelocity(GetPlayerVehicleID(playerid), vx*0, vy*0, vz*0);
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
How to make this only for V.I.P ? - by Symphony - 29.01.2014, 23:18
Re: How to make this only for V.I.P ? - by ross8839 - 29.01.2014, 23:37
Re: How to make this only for V.I.P ? - by Shockey HD - 30.01.2014, 02:28
Re: How to make this only for V.I.P ? - by Symphony - 30.01.2014, 05:34

Forum Jump:


Users browsing this thread: 2 Guest(s)