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

Hello guy's, I have been searched all the wiki of samp.
but i dont have any idea.
can you help me to make this code only for V.I.P (Luxadmin) Make it to the command that only V.I.P can access i mean.
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	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
#2

Couldn't you make a team for VIP's and then verify if they're a member of that team? and do it that way..? and bit like a command for say a cop? I haven't scripted for a while so that's the only way I'd know how to do it
Reply
#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
#4

Thank you so much for helping me .
I'm still noob at pawning xD.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)