02.02.2013, 11:52
try this
pawn Код:
CMD:weaps(playerid, params[])
{
new id,string[128];
if(PlayerInfo[playerid][Level] < 1)
return SendClientMessage(playerid, COLOR_RED,"You need to be Basic Moderator to use this command");
if(sscanf(params,"i",id)) {
SendClientMessage(playerid, COLOR_RED,""Server_Grey"USAGE: /weaps [id]");
SendClientMessage(playerid, COLOR_RED,""Server_Grey"Function: This will show what weapon player have");
return 1;
}
if(!IsPlayerConnected(id))
return SendClientMessage(playerid, COLOR_RED,"Player is not connected");
new Count,w,a,wName[24];
for(new solt = 0; solt != 12; solt ++) {
GetPlayerWeaponData(id, solt, w, a);
if( w != 0 && a != 0)
Count ++;
}
if(Count < 1)
return SendClientMessage(playerid, COLOR_RED,"This player dont have weapon!");
if(Count >= 1)
{
for(new solt = 0; solt != 12; solt ++)
{
new nName[24];
GetPlayerWeaponData(id, solt, w, a);
if(w != 0 && a != 0)
{
GetWeaponName(w, nName, 24);
format(string,128,"Weapon: %s. Ammo: %d.",wName,a);
SendClientMessage(playerid, COLOR_WHITE,string);
}
}
}
return 1;
}