04.06.2012, 17:59
pawn Код:
COMMAND:dropgun(playerid, params[])
{
if(PlayerInfo[playerid][pConnectTime] < 3)
{
return SendClientMessage(playerid, COLOR_GREY, " This command is restricted to: TLS 3 and above");
}
if (GetPlayerWeapon(playerid) < 2 || GetPlayerWeapon(playerid) > 34)
{
SendClientMessage(playerid, COLOR_GREY, " You cannot drop this weapon !");
return 1;
}
new Float:PlayersHealth;
GetPlayerHealth(playerid, PlayersHealth);
if (PlayersHealth == 0.0)
{
SendClientMessage(playerid, COLOR_GREY, " You have no access to drop this weapon at your health !");
return 1;
}
new sendername;
line 22 GetPlayerName(playerid, sendername, sizeof(sendername));
line 23 GiveNameSpace(sendername);
line 24 if(PlayerInfo[playerid][pMaskuse] == 1) { format(sendername, sizeof(sendername), "Stranger_%d", line 25 PlayerInfo[playerid][pRandMask]); }
format(string, sizeof(string), "* %s drops his weapon to the ground.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new gunID = GetPlayerWeapon(playerid);
new gunAmmo = GetPlayerAmmo(playerid);
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X, Y, Z);
RemovePlayerWeaponEx(playerid, gunID);
SendClientMessage(playerid, COLOR_GREY, " You dropped your weapon onto the ground.");
DropWeapons(gunID,gunAmmo,X,Y,Z,GetPlayerVirtualWorld(playerid),playerid);
return 1;
}
COMMAND:dgun(playerid, params[])
{
return cmd_dropgun(playerid, params);
}