/weaps help
#1

Well im trying to make if admin does /weaps [id], it will show what weapons that player has and how many ammos. please help
pawn Код:
CMD:weaps(playerid, params[])
{
    if(PlayerData[playerid][AdminLevel] > 0)
    {
        new id,str[128],WeapName[24],weap,name[MAX_PLAYER_NAME];
        if(sscanf(params,"u",id)) return SendClientMessage(playerid,0xFF9900AA,"USAGE: /weaps [id]");
        if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF0000FF,"That user is not connected.");
        GetPlayerName(id,name,sizeof(name));
        GetWeaponName(weap,WeapName,sizeof(WeapName));
        format(str,sizeof(str),"|| %s Weapons ||",name);
        SendClientMessage(playerid,0xFF9900AA,str);
        format(str,sizeof(str),"%s(%d)",WeapName,GetPlayerAmmo(id));
        SendClientMessage(playerid,0xFF9900AA,str);
    }
    else return 0;
    return 1;
}
Reply
#2

pawn Код:
CMD:weaps(playerid, params[])
{
    if(PlayerData[playerid][AdminLevel] > 0)
    {
        new id,str[128],WeapName[24],weap,name[MAX_PLAYER_NAME];
        if(sscanf(params,"u",id)) return SendClientMessage(playerid,0xFF9900AA,"USAGE: /weaps [id]");
        if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF0000FF,"That user is not connected.");
        GetPlayerName(id,name,sizeof(name));
        new ammo = GetPlayerAmmo(playerid);
        GetWeaponName(weap,WeapName,sizeof(WeapName));
        format(str,sizeof(str),"|| Weapon name: %s --- Ammo: %d ||",name,ammo);
        SendClientMessage(playerid,0xFF9900AA,str);
        format(str,sizeof(str),"%s(%d)",WeapName,GetPlayerAmmo(id));
        SendClientMessage(playerid,0xFF9900AA,str);
    }
    else return 0;
    return 1;
}
Reply
#3

still wont work, it wont show gun name
Reply
#4

pawn Код:
CMD:weaps(playerid, params[])
{
    if(PlayerData[playerid][AdminLevel] > 0)
    {
        new id,str[128],WeapName[24],weap,name[MAX_PLAYER_NAME];
        if(sscanf(params,"u",id)) return SendClientMessage(playerid,0xFF9900AA,"USAGE: /weaps [id]");
        if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF0000FF,"That user is not connected.");
        GetPlayerName(id,name,sizeof(name));
        new ammo = GetPlayerAmmo(playerid);
        GetWeaponName(weap,WeapName,sizeof(WeapName));
        format(str,sizeof(str),"|| Weapon name: %s --- Ammo: %d ||",WeapName,ammo);
        SendClientMessage(playerid,0xFF9900AA,str);
        format(str,sizeof(str),"%s(%d)",WeapName,GetPlayerAmmo(id));
        SendClientMessage(playerid,0xFF9900AA,str);
    }
    else return 0;
    return 1;
}
There, fixed:P
Reply
#5

it still wont work, it shows
pawn Код:
|| Weapon name:  --- Ammo: -31073 ||
(-31073)
in server while i have an desert eagle pistol with 99999 ammmo
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)