29.08.2015, 14:14
is there anyway to stop f abuse,g abuse, and spray bug
CMD:dance(playerid, params[])
{
if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_ENTER_VEHICLE)
return SendClientMessage(playerid, -1, "You can't use this command while entering a vehicle.");
else
{
switch(strval(params))
{
case 1: SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE1);
case 2: SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE2);
case 3: SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE3);
case 4: SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE4);
default: SendClientMessage(playerid,-1,"Invalid dance style.");
}
}
return 1;
}
// Below could be vastly improved.
// Below might not even work, but it's worth a try.
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_SECONDARY_ATTACK)
{
if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_NONE && !IsPlayerInAnyVehicle(playerid))
{
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
}
}
return 1;
}