04.06.2012, 19:15
When i drop the gun is wont come up on the ground
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 giveplayerid;
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);
if(PlayerInfo[playerid][pSex] == 1)
{
PlayerPlayerActionMessage(playerid,giveplayerid,20.0,"drops his weapon to the ground.");
} else {
PlayerPlayerActionMessage(playerid,giveplayerid,20.0,"drops her weapon to the ground.");
}
return 1;
}