The names is wrong?
#1

The names is wrong
if the players type /weaps show the names
if the player type /weaps [id] it still show names their name.


Код:
CMD:weaps(playerid, params[])
{
    if (APlayerData[playerid][PlayerLevel] >= 4)
	{
	    if(!strlen(params)) return
		SendClientMessage(playerid, 0xFF0000FF, "Usage: /weaps [PlayerID]") &&
		SendClientMessage(playerid, 0xFF0000FF, "Function: See weapons of specified player");
    	new player1;
		new Count, x;
		new string[128], string2[64];
		new WeapName[24], slot, weap, ammo;
        new name[MAX_PLAYER_NAME+1];
        GetPlayerName(playerid, name, sizeof(name));
		player1 = strval(params);
	 	if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
		 {
			format(string2,sizeof(string2),"%s Weapons:",name);
			SendClientMessage(playerid,0xFF0000FF,string2);
			for(slot = 0; slot < 14; slot++)
			{
			GetPlayerWeaponData(player1, slot, weap, ammo);
			if( ammo != 0 && weap != 0)
			Count++;
			}
			if(Count < 1)
			return SendClientMessage(playerid,0xFF0000FF,"No Weapons found!");

			if(Count >= 1)
			{
				for (slot = 0; slot < 14; slot++)
				{
				GetPlayerWeaponData(player1, slot, weap, ammo);

				if( ammo != 0 && weap != 0)
				{
				GetWeaponName(weap, WeapName, sizeof(WeapName));
				if(ammo == 65535 || ammo == 1)
				format(string,sizeof(string),"%s%s",string, WeapName);
				else format(string,sizeof(string),"%s [Weapon: %s] [Ammo: %d]",string, WeapName, ammo);
				x++;
				if(x >= 5)
				{
	 			SendClientMessage(playerid, 0xFF0000FF, string);
	 			x = 0;
				format(string, sizeof(string), "");
				}
				else format(string, sizeof(string), "%s", string);
				}
			    }
				if(x <= 4 && x > 0)
				{
    			SendClientMessage(playerid, 0xFF0000FF, string);
				}
		    }
		}
	}
	return 1;
}
Reply
#2

What exactly your bug
Reply
#3

Names.
if the player use the command it still show their name
not the player names with [id]
Reply
#4

pawn Код:
CMD:weaps(playerid, params[])
{
    if (APlayerData[playerid][PlayerLevel] >= 4)
    {
        if(!strlen(params)) return
        SendClientMessage(playerid, 0xFF0000FF, "Usage: /weaps [PlayerID]") &&
        SendClientMessage(playerid, 0xFF0000FF, "Function: See weapons of specified player");
        new player1;
        new Count, x;
        new string[128], string2[64];
        new WeapName[24], slot, weap, ammo;
        new name[MAX_PLAYER_NAME+1];
        GetPlayerName(playerid, name, sizeof(name));
        player1 = strval(params);
        if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
         {
            format(string2,sizeof(string2),"%s Weapons:",name);
            SendClientMessage(playerid,0xFF0000FF,string2);
            for(slot = 0; slot < 14; slot++)
            {
            GetPlayerWeaponData(player1, slot, weap, ammo);
            if( ammo != 0 && weap != 0)
            Count++;
            }
            if(Count < 1)
            return SendClientMessage(playerid,0xFF0000FF,"No Weapons found!");

            if(Count >= 1)
            {
                for (slot = 0; slot < 14; slot++)
                {
                GetPlayerWeaponData(player1, slot, weap, ammo);

                if( ammo != 0 && weap != 0)
                {
                GetWeaponName(weap, WeapName, sizeof(WeapName));
                if(ammo == 65535 || ammo == 1)
                format(string,sizeof(string),"%s%s",string, WeapName);
                else format(string,sizeof(string),"%s(%d) [Weapon: %s] [Ammo: %d]",string,player1, WeapName, ammo);
                x++;
                if(x >= 5)
                {
                SendClientMessage(playerid, 0xFF0000FF, string);
                x = 0;
                format(string, sizeof(string), "");
                }
                else format(string, sizeof(string), "%s", string);
                }
                }
                if(x <= 4 && x > 0)
                {
                SendClientMessage(playerid, 0xFF0000FF, string);
                }
            }
        }
    }
    return 1;
}
I think if you want show thier id after the name in the clientmessage
Reply
#5

Quote:
Originally Posted by TomatoRage
Посмотреть сообщение
pawn Код:
CMD:weaps(playerid, params[])
{
    if (APlayerData[playerid][PlayerLevel] >= 4)
    {
        if(!strlen(params)) return
        SendClientMessage(playerid, 0xFF0000FF, "Usage: /weaps [PlayerID]") &&
        SendClientMessage(playerid, 0xFF0000FF, "Function: See weapons of specified player");
        new player1;
        new Count, x;
        new string[128], string2[64];
        new WeapName[24], slot, weap, ammo;
        new name[MAX_PLAYER_NAME+1];
        GetPlayerName(playerid, name, sizeof(name));
        player1 = strval(params);
        if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
         {
            format(string2,sizeof(string2),"%s Weapons:",name);
            SendClientMessage(playerid,0xFF0000FF,string2);
            for(slot = 0; slot < 14; slot++)
            {
            GetPlayerWeaponData(player1, slot, weap, ammo);
            if( ammo != 0 && weap != 0)
            Count++;
            }
            if(Count < 1)
            return SendClientMessage(playerid,0xFF0000FF,"No Weapons found!");

            if(Count >= 1)
            {
                for (slot = 0; slot < 14; slot++)
                {
                GetPlayerWeaponData(player1, slot, weap, ammo);

                if( ammo != 0 && weap != 0)
                {
                GetWeaponName(weap, WeapName, sizeof(WeapName));
                if(ammo == 65535 || ammo == 1)
                format(string,sizeof(string),"%s%s",string, WeapName);
                else format(string,sizeof(string),"%s(%d) [Weapon: %s] [Ammo: %d]",string,player1, WeapName, ammo);
                x++;
                if(x >= 5)
                {
                SendClientMessage(playerid, 0xFF0000FF, string);
                x = 0;
                format(string, sizeof(string), "");
                }
                else format(string, sizeof(string), "%s", string);
                }
                }
                if(x <= 4 && x > 0)
                {
                SendClientMessage(playerid, 0xFF0000FF, string);
                }
            }
        }
    }
    return 1;
}
I think if you want show thier id after the name in the clientmessage
no.
if a player type /weaps still not showing the player right now.
Test [Weapon: %s] [Ammo: %d]
player type dis
it show's dis
not showing the right names.
Test [Weapon: %s] [Ammo: %d]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)