Код:
CMD:deixararma(playerid)
{
new pMinhaArma;
new pMinhasBalas;
if(!GetPlayerWeapon(playerid)) return SendClientMessage(playerid, -1, "{FF0000}Vocк nгo tem uma arma !");
for(new i = 0; i < sizeof(InfoArma); i++)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
InfoArma[i][PosX] = X;
InfoArma[i][PosY] = Y;
InfoArma[i][PosZ] = Z;
InfoArma[i][gArmaID] = pMinhaArma;
InfoArma[i][gQuantBalas] = pMinhasBalas;
pMinhaArma = GetPlayerWeapon(playerid);
pMinhasBalas = GetPlayerAmmo(playerid);
ObjetoID[i] = CreateDynamicObject(GetWeaponID(GetPlayerWeapon(playerid)), X, Y, Z-1, 90.0000, 0.0000, 0.0000);
RemovePlayerWeapon(playerid, GetPlayerWeapon(playerid));
}
return true;
}
Код:
CMD:pegararma(playerid)
{
for(new i = 0; i < sizeof(InfoArma); i++)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, InfoArma[gInfoGun][PosX], InfoArma[gInfoGun][PosY], InfoArma[gInfoGun][PosZ]))
{
GivePlayerWeapon(playerid, InfoArma[i][gArmaID], InfoArma[i][gQuantBalas]);
DestroyDynamicObject(ObjetoID[i]);
InfoArma[i][PosX] = 0.0;
InfoArma[i][PosY] = 0.0;
InfoArma[i][PosZ] = 0.0;
InfoArma[i][gArmaID] = 0;
InfoArma[i][gQuantBalas] = 0;
}
}
}