05.10.2011, 22:10
Hello how i can add a commands in my GM for CHECK the weapons that have a player?
new Weapons[12][2];//global variable
CMD:checkweapons(playerid, params[])
{
new id,stringp[58];
if(sscanf(params, "u",id))
return SendClientMessage(playerid, -1, "Usage: /checkweapons [playerid]");
new weaponname[32];
for(new i=0; i<13; i++)
{
GetPlayerWeaponData(id, i, Weapons[i][0], Weapons[i][1]);
if(Weapons[i][0] != 0 && Weapons[i][1] > 0)
{
GetWeaponName(Weapons[i][0], weaponname, 32);
format(stringp, 58, "Weapon[%s] <---> Ammo[%d]", weaponname, Weapons[i][1]);
SendClientMessage(playerid, -1, strinngp);
}
}
return 1;
}