who can help me please
#1

hi all
here in my code
PHP код:
CMD:stats(playeridparams[])
{
if(
IsPlayerConnected(playerid))
{
    
StatsShow(playerid,playerid);
    }
return 
1;}
public 
StatsShow(playerid,targedid)
{
new 
PlayerInfo[playerid][Pass];
new 
PlayerInfo[playerid][Cash];
new 
PlayerInfo[playerid][Admin];
new 
PlayerInfo[playerid][Kills];
new 
PlayerInfo[playerid][Deaths];
new 
PlayerInfo[playerid][Xp];
new 
PlayerInfo[playerid][Infect];
new 
PlayerInfo[playerid][Rank];
new 
PlayerInfo[playerid][Mute];
new 
pName[MAX_PLAYER_NAME];
GetPlayerName(targedidpNamesizeof(pName));
new 
message[128];
new 
message2[128];
new 
message3[128];
new 
message4[128];
format (messagesizeof(message), "Player:%s || Password:%i || Cash:%i",pName);
format (message2sizeof(message2), "Admin Level:%i || Kills:%i || Deaths:%i",c);
format (message3sizeof(message3), "XP Points:%i || Infected:%i || Rank:%i",f);
format (message4sizeof(message4), "Muted:%i",);
SendClientMessage(playeridwhite"Player Stats");
SendClientMessage(playeridaquamessage);
SendClientMessage(playeridaquamessage2);
SendClientMessage(playeridaquamessage3);
SendClientMessage(playeridaquamessage4);
return 
1;} 
How can i make this then type /stats to show me text no number i have 3 rangs Soldier, General, Marshal how can man to show them
Reply
#2

Hey man, there's probably a better way to do it but I think this should work, assuming that the function works but shows numbers instead of the word.

Код:
public StatsShow(playerid,targedid) 
{ 

new a = PlayerInfo[playerid][Pass]; 
new b = PlayerInfo[playerid][Cash]; 
new c = PlayerInfo[playerid][Admin]; 
new d = PlayerInfo[playerid][Kills]; 
new e = PlayerInfo[playerid][Deaths]; 
new f = PlayerInfo[playerid][Xp]; 
new g = PlayerInfo[playerid][Infect]; 
new h = PlayerInfo[playerid][Rank]; 
new i = PlayerInfo[playerid][Mute]; 

new pName[MAX_PLAYER_NAME]; 
GetPlayerName(targedid, pName, sizeof(pName)); 

new message[128]; 
new message2[128]; 
new message3[128]; 
new message4[128];
format (message, sizeof(message), "Player:%s || Password:%i || Cash:%i",pName, a , b ); 
format (message2, sizeof(message2), "Admin Level:%i || Kills:%i || Deaths:%i",c, d , e ); 
if(h == 1)
{
format (message3, sizeof(message3), "XP Points:%i || Infected:%i || Rank:Soldier",f, g );
}
else if(h == 2)
{
format (message3, sizeof(message3), "XP Points:%i || Infected:%i || Rank:General",f, g );
}
else if(h == 3)
{
format (message3, sizeof(message3), "XP Points:%i || Infected:%i || Rank:Marshall",f, g ); 
}
format (message4, sizeof(message4), "Muted:%i",i );
SendClientMessage(playerid, white, "Player Stats"); 
SendClientMessage(playerid, aqua, message); 
SendClientMessage(playerid, aqua, message2); 
SendClientMessage(playerid, aqua, message3); 
SendClientMessage(playerid, aqua, message4); 
return 1;
}
Hope it works for you, good luck.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)