SA-MP Forums Archive
a small problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: a small problem (/showthread.php?tid=292636)



a small problem - V4at - 24.10.2011

When I wrote this command, me show just my stats. And the other players do not show.

Код:
dcmd_rank( playerid, params[] )
{
	new id;
	if (strlen(params))
	{
	    id = strval(params);
	    if(IsPlayerConnected(id))
	    {
			new str[256];

			SendClientMessage(playerid,COLOR_YELLOW,"[FunZoneLT]>> Dabartinis lygis:");
			GetPlayerRank(playerid);
			format(str,sizeof(str),"[FunZoneLT]>> Nuzudymai: %d  Mirtys: %d ",GetPlayerKills(playerid),GetPlayerDeaths(playerid));
			SendClientMessage(playerid,0x00FF00AA,str);


	    }
	    else
	    {
	        SendClientMessage(playerid,0x00FF00AA, "[FunZoneLT]>> Tokio zaidejo nera.");
	    }
	}
	else
	{
	SendClientMessage(playerid,0x00FF00AA, "[FunZoneLT]>> /rank [zaidejoid]");

	}
	return 1;
}



Re: a small problem - LetsOWN[PL] - 24.10.2011

pawn Код:
SendClientMessageToAll(playerid,0x00FF00AA,str);
instead of
pawn Код:
SendClientMessage(playerid,0x00FF00AA,str);
.

As always, u can make your own loop, using this formula:
pawn Код:
for(new i = 0; i != MAX_PLAYERS; i++)
..

LetsOWN.


Re : a small problem - V4at - 24.10.2011

Why
Код:
SendClientMessageToAll(playerid,0x00FF00AA,str);
?

My do not show the others players statistics, which show only mine.

where to put?
Код:
for(new i = 0; i != MAX_PLAYERS; i++)
?


Re: a small problem - [MWR]Blood - 24.10.2011

pawn Код:
dcmd_rank( playerid, params[] )
{
    new id;
    if (strlen(params))
    {
        id = strval(params);
        if(IsPlayerConnected(id))
        {
            new str[256];

            SendClientMessage(id,COLOR_YELLOW,"[FunZoneLT]>> Dabartinis lygis:");
            GetPlayerRank(id);
            format(str,sizeof(str),"[FunZoneLT]>> Nuzudymai: %d  Mirtys: %d ",GetPlayerKills(id),GetPlayerDeaths(id));
            SendClientMessage(id,0x00FF00AA,str);


        }
        else
        {
            SendClientMessage(playerid,0x00FF00AA, "[FunZoneLT]>> Tokio zaidejo nera.");
        }
    }
    else
    {
    SendClientMessage(playerid,0x00FF00AA, "[FunZoneLT]>> /rank [zaidejoid]");

    }
    return 1;
}
This one should work!


Re : a small problem - V4at - 25.10.2011

Now show only my statistic! And other players do not show! Me need that other players statistic show, also me statistic, wrote its id. You know?


Re: a small problem - SuperViper - 25.10.2011

Me need that you speak english.


Re : a small problem - V4at - 25.10.2011

Other players' statistics do not show, only mine.


Re : a small problem - V4at - 25.10.2011

No one knows?