/stats
#4

Quote:
Originally Posted by Boolean
Посмотреть сообщение
Add this to your command.

pawn Код:
new variable[4];
if(CanUseCIA[playerid]) format(variable, sizeof(variable), "Yes");
else format(variable, sizeof(variable), "No");
return variable;
Then replace this
pawn Код:
format(temp, sizeof(temp), "Army: %d\n",CanUseArmy[playerid]);
strcat(info, temp);
with

pawn Код:
format(temp, sizeof(temp), "Army: %s\n", variable);
strcat(info, temp);
PHP код:
dcmd_getstats(playerid,params[])
{
    new 
ID;
    new 
Float:gihpFloat:giar;
    
GetPlayerHealth(IDgihp);
    
GetPlayerArmour(IDgiar);
    
GetPlayerWantedLevel(ID);
    new 
temp[1000];
    new 
info[1000];
    
    if(
sscanf(params"u"ID))
    {
        
SendClientMessage(playerid,COLOR_ERROR,"USAGE: /tinfo (Player Name/ID)");
        return 
1;
    }
    if(
IsSpawned[playerid] != 1)
    {
        
SendClientMessage(playerid,COLOR_ERROR,"You must be alive and spawned in order to be able to use this command.");
        return 
1;
    }
    
format(tempsizeof(temp), "Name: %s(%d)\n",PlayerName(ID),ID);
    
strcat(infotemp);
    
format(tempsizeof(temp), "Score: %i\n",GetPlayerScore(ID));
    
strcat(infotemp);
    
format(tempsizeof(temp), "Cash: %d$\n",GetPlayerMoney(ID));
    
strcat(infotemp);
    
format(tempsizeof(temp), "Bank Cash: %d$\n",BankCash[ID]);
    
strcat(infotemp);
    
format(tempsizeof(temp), "Admin Level: %d\n",AdminLevel[ID]);
    
strcat(infotemp);
    
format(tempsizeof(temp), "Army: %d\n",CanUseArmy[ID]);
    
strcat(infotemp);
    new 
variable[4];
    if(
CanUseCIA[playerid] == 1337format(variablesizeof(variable), "Yes");
    else 
format(variablesizeof(variable), "No");
    return 
variable;
    
    
format(tempsizeof(temp), "CIA: %d\n",variable);
    
strcat(infotemp);
    
format(tempsizeof(temp), "Regular Player: %d\n",IsRegularPlayer[ID]);
    
strcat(infotemp);
    
format(tempsizeof(temp), "Trusted Regular Player: %d\n",IsTRP[ID]);
    
strcat(infotemp);
    
format(tempsizeof(temp), "Warns: %d\n",Warns[ID]);
    
strcat(infotemp);
    
format(tempsizeof(temp), "Terrorist Skill: %d\n",TerroristSkill[ID]);
    
strcat(infotemp);
    
format(tempsizeof(temp), "Rob Skill: %d\n",RobSkill[ID]);
    
strcat(infotemp);
    
format(tempsizeof(temp), "Cop Rank: %d\n",CopRank[ID]);
    
strcat(infotemp);
    
format(tempsizeof(temp), "Has C4: %d\n",HasC4[ID]);
    
strcat(infotemp);
    
format(tempsizeof(temp), "Secure Wallet: %d\n",HasSecureWallet[ID]);
    
strcat(infotemp);
    
format(tempsizeof(temp), "Condoms: %d\n",HasCondoms[ID]);
    
strcat(infotemp);
    
format(tempsizeof(temp), "Ropes: %d\n",HasRope[ID]);
    
strcat(infotemp);
    
format(tempsizeof(temp), "Scissors: %d\n",HasScissors[ID]);
    
strcat(infotemp);
    
format(tempsizeof(temp), "Kills: %d\n",Kills[ID]);
    
strcat(infotemp);
    
format(tempsizeof(temp), "Deaths: %d\n",Deaths[ID]);
    
strcat(infotemp);
    
ShowPlayerDialog(playerid,DIALOG_STATSDIALOG_STYLE_MSGBOX,"{53C506}Stats",info,"Close","");
    return 
true;

ERRORS:
PHP код:
D:\Games\SFCRRPGv1.1\Best\gamemodes\SFCRRPG.pwn(4424) : error 033: array must be indexed (variable "dcmd_tinfo")
D:\Games\SFCRRPGv1.1\Best\gamemodes\SFCRRPG.pwn(5716) : error 079inconsistent return types (array & non-array)
D:\Games\SFCRRPGv1.1\Best\gamemodes\SFCRRPG.pwn(5721) : error 079inconsistent return types (array & non-array)
D:\Games\SFCRRPGv1.1\Best\gamemodes\SFCRRPG.pwn(5746) : warning 225unreachable code
D
:\Games\SFCRRPGv1.1\Best\gamemodes\SFCRRPG.pwn(5789) : error 079inconsistent return types (array & non-array)
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
4 Errors

and dEcoor's one , shows numbers , don't show words .
Reply


Messages In This Thread
/stats - by nor15 - 07.07.2013, 04:10
Re: /stats - by Boolean - 07.07.2013, 08:22
Re: /stats - by dEcooR - 07.07.2013, 09:34
Re: /stats - by nor15 - 07.07.2013, 14:15
Re: /stats - by ReVo_ - 07.07.2013, 14:24
Re: /stats - by Jefff - 07.07.2013, 14:49

Forum Jump:


Users browsing this thread: 4 Guest(s)