30.01.2014, 02:28
Do you have any VIP variables?
If not lets make some.
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;
}