01.09.2011, 21:47
(
Последний раз редактировалось Padarom; 01.09.2011 в 22:18.
)
Of course
I think this is all you wanted to know and hope it helped
pawn Код:
new bool:ToldOutOfAmmo[MAX_PLAYERS]=false;
//OnPlayerCommandText
if(!strcmp(cmdtext, "/reload", true) == 0)
{
if(GetPVarInt(playerid,"weaponid") != 0)
{
GivePlayerWeapon(playerid, GetPVarInt(playerid,"weaponid"), 100); // Give the player the weapon + ammo
ToldOutOfAmmo[playerid]=false; // Reset out of ammo message
SetPVarInt(playerid,"weaponid",0) // Reset weaponid
SendClientMessage(playerid,COLOR_RED,"Weapon reloaded.");
}
else SendClientMessage(playerid,COLOR_RED,"You are not out of ammo.");
return 1;
}
// Under OnPlayerUpdate
if(GetPlayerWeaponState(playerid) == 1)
{
if(ToldOutOfAmmo[playerid] == false)
{
ToldOutOfAmmo[playerid] = true;
SetPVarInt(playerid,"weaponid",GetPlayerWeapon(playerid));
SendClientMessage(playerid, COLOR_RED, "You're out of ammo. Type /reload");
}
}