#13

Of course
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");
}
}
I think this is all you wanted to know and hope it helped
Reply


Messages In This Thread
ammo - by Zonoya - 01.09.2011, 20:10
AW: ammo - by Padarom - 01.09.2011, 20:21
AW: ammo - by Zonoya - 01.09.2011, 20:23
Re: ammo - by Vince - 01.09.2011, 20:25
Re: ammo - by Zonoya - 01.09.2011, 20:29
AW: ammo - by Padarom - 01.09.2011, 20:31
Re: ammo - by Zonoya - 01.09.2011, 20:35
Re: ammo - by Zonoya - 01.09.2011, 21:04
Respuesta: ammo - by Alex_Obando - 01.09.2011, 21:10
Re: ammo - by Zonoya - 01.09.2011, 21:15
AW: ammo - by Padarom - 01.09.2011, 21:20
Re: ammo - by Zonoya - 01.09.2011, 21:22
AW: ammo - by Padarom - 01.09.2011, 21:47
Re: ammo - by Zonoya - 02.09.2011, 08:19

Forum Jump:


Users browsing this thread: 4 Guest(s)