Simple help :D
#1

I forgot how to make the /stats command with this codes
Can you type me the code to make the /stats command with the kills/cash and this shits?

Here's the code of my pkills and this things


Quote:

enum pInfo
{
pPass,
pCash,
pAdmin,
pKills,
pDeaths
}

Reply
#2

I'm such an idiot, excuse me.
Reply
#3

Easy example

Код:
enum pInfo
{
    pMoney
}
Код:
new PlayerInfo[MAX_PLAYERS][pInfo];
Код:
new str[100];
PlayerInfo[playerid][pMoney] = GetPlayerMoney(playerid);
format(str,sizeof(str),"Money: %d", PlayerInfo[playerid][pMoney]);
SendClientMessage(playerid, 0xFFFFFFFF,str);
Reply
#4

Код:
enum pInfo
{
	pPass,
	pCash,
	pAdmin,
	pKills,
	pDeaths
}
new PlayerInfo[MAX_PLAYERS][pInfo]; // In the upper part of the script.

CMD:stats(params, playerid) // In the lower part of the script.
{
	new pName[MAX_PLAYER_NAME], string[126];
	GetPlayerName(playerid, pName, sizeof(pName));
	
	if(IsPlayerConnected)
	{
		format(string, sizeof(string), "________________%s's stats_______________", pName);
		format(string, sizeof(string), "Money: %d , Kills: %d , Deaths: %d", PlayerInfo[playerid][pCash], PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths]);
		format(string, sizeof(string), "________________________________________");
		SendClientMessage(playerid, -1, string);
	}
	else
	{
		SendClientMessage(playerid, -1, "You are not connected.");
	}
	return 1;
}
Reply
#5

Quote:
Originally Posted by SpikeSpigel
Посмотреть сообщение
Код:
enum pInfo
{
	pPass,
	pCash,
	pAdmin,
	pKills,
	pDeaths
}
new PlayerInfo[MAX_PLAYERS][pInfo]; // In the upper part of the script.

CMD:stats(params, playerid) // In the lower part of the script.
{
	new pName[MAX_PLAYER_NAME], string[126];
	GetPlayerName(playerid, pName, sizeof(pName));
	
	if(IsPlayerConnected)
	{
		format(string, sizeof(string), "________________%s's stats_______________", pName);
		format(string, sizeof(string), "Money: %d , Kills: %d , Deaths: %d", PlayerInfo[playerid][pCash], PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths]);
		format(string, sizeof(string), "________________________________________");
		SendClientMessage(playerid, -1, string);
	}
	else
	{
		SendClientMessage(playerid, -1, "You are not connected.");
	}
	return 1;
}
Didn't work
Reply
#6

Quote:
Originally Posted by MichaelJones
Посмотреть сообщение
Didn't work
What's exactly not working ?
Reply
#7

Quote:
Originally Posted by SpikeSpigel
Посмотреть сообщение
Код:
	if(IsPlayerConnected)
Who are you checking is connected? IsPlayerConnected(playerid)
Reply
#8

Quote:
Originally Posted by StuartD
Посмотреть сообщение
Who are you checking is connected? IsPlayerConnected(playerid)
Auch. My bad, thank you for modifying it !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)