2023-08-29, 04:44 AM
(This post was last modified: 2023-08-29, 04:46 AM by naufalikbal00783.)
Its possible to make that?.. when somebody dont have more ammo, the weapon dont dissapear?
[Pawn] Don't Destroy the weapon when ammo is 0
|
2023-08-29, 04:44 AM
(This post was last modified: 2023-08-29, 04:46 AM by naufalikbal00783.)
Its possible to make that?.. when somebody dont have more ammo, the weapon dont dissapear?
forward BlockWeaponMSG(playerid);
#define SystemMSG 99 new msg[MAX_PLAYERS]; public OnPlayerConnect(playerid) { msg[playerid] = 0; return 1; } public OnPlayerUpdate (playerid) { new strcmd [9]; if( GetPlayerAmmo(playerid) == 2) { if(msg[playerid] == 0) { strcat(strcmd, "no ammo", sizeof(strcmd)); ShowPlayerDialog(playerid, SystemMSG, DIALOG_STYLE_MSGBOX, "System", strcmd, "Exit", ""); msg[playerid] = 1; SetTimer("BlockWeaponMSG", 3000, false); } } return 1; } public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ) { new strcmd [9]; if( GetPlayerAmmo(playerid) == 3) { strcat(strcmd, "no ammo", sizeof(strcmd)); ShowPlayerDialog(playerid, SystemMSG, DIALOG_STYLE_MSGBOX, "System", strcmd, "Exit", ""); } if( GetPlayerAmmo(playerid) == 2) { strcat(strcmd, "no ammo", sizeof(strcmd)); ShowPlayerDialog(playerid, SystemMSG, DIALOG_STYLE_MSGBOX, "System", strcmd, "Exit", ""); } return 1; } public BlockWeaponMSG(playerid) { msg[playerid] = 0; return 1; } |