dcmd_stats(playerid,params[])
{
#pragma unused params
new Float:gihp, Float:giar;
GetPlayerHealth(playerid, gihp);
GetPlayerArmour(playerid, giar);
GetPlayerWantedLevel(playerid);
new string[128];
new temp[1000];
new info[1000];
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(temp, sizeof(temp), "Name: %s(%d)\n",PlayerName(playerid),playerid);
strcat(info, temp);
format(temp, sizeof(temp), "Score: %i\n",GetPlayerScore(playerid));
strcat(info, temp);
format(temp, sizeof(temp), "Cash: %d$\n",GetPlayerMoney(playerid));
strcat(info, temp);
format(temp, sizeof(temp), "Bank Cash: %d$\n",BankCash[playerid]);
strcat(info, temp);
format(temp, sizeof(temp), "Admin Level: %d\n",AdminLevel[playerid]);
strcat(info, temp);
format(temp, sizeof(temp), "Army: %d\n",CanUseArmy[playerid]);
strcat(info, temp);
format(temp, sizeof(temp), "CIA: %d\n",CanUseCIA[playerid]);
strcat(info, temp);
format(temp, sizeof(temp), "Regular Player: %d\n",IsRegularPlayer[playerid]);
strcat(info, temp);
format(temp, sizeof(temp), "Trusted Regular Player: %d\n",IsTRP[playerid]);
strcat(info, temp);
format(temp, sizeof(temp), "Warns: %d\n",Warns[playerid]);
strcat(info, temp);
format(temp, sizeof(temp), "Terrorist Skill: %d\n",TerroristSkill[playerid]);
strcat(info, temp);
format(temp, sizeof(temp), "Rob Skill: %d\n",RobSkill[playerid]);
strcat(info, temp);
format(temp, sizeof(temp), "Cop Rank: %d\n",CopRank[playerid]);
strcat(info, temp);
format(temp, sizeof(temp), "Has C4: %d\n",HasC4[playerid]);
strcat(info, temp);
format(temp, sizeof(temp), "Secure Wallet: %d\n",HasSecureWallet[playerid]);
strcat(info, temp);
format(temp, sizeof(temp), "Condoms: %d\n",HasCondoms[playerid]);
strcat(info, temp);
format(temp, sizeof(temp), "Ropes: %d\n",HasRope[playerid]);
strcat(info, temp);
format(temp, sizeof(temp), "Scissors: %d\n",HasScissors[playerid]);
strcat(info, temp);
format(temp, sizeof(temp), "Kills: %d\n",Kills[playerid]);
strcat(info, temp);
format(temp, sizeof(temp), "Deaths: %d\n",Deaths[playerid]);
strcat(info, temp);
ShowPlayerDialog(playerid,DIALOG_STATS, DIALOG_STYLE_MSGBOX,"{53C506}Stats",info,"Close","");
format(string,sizeof(string),"[ADMIN SPY] %s(%d) has typed /stats.",PlayerName(playerid),playerid);
SendClientMessageToAllAdmins(string);
return true;
}
new variable[4];
if(CanUseCIA[playerid]) format(variable, sizeof(variable), "Yes");
else format(variable, sizeof(variable), "No");
return variable;
format(temp, sizeof(temp), "Army: %d\n",CanUseArmy[playerid]);
strcat(info, temp);
format(temp, sizeof(temp), "Army: %s\n", variable);
strcat(info, temp);
stock YesNo(playerid) { new string[5]; switch(CanUseCIA[playerid]) { case 0: string = "No"; case 1: string = "Yes"; } return string; }
format(temp, sizeof(temp), "CIA: %s\n",YesNo(playerid)); strcat(info, temp);
Add this to your command.
pawn Код:
pawn Код:
pawn Код:
|
dcmd_getstats(playerid,params[])
{
new ID;
new Float:gihp, Float:giar;
GetPlayerHealth(ID, gihp);
GetPlayerArmour(ID, giar);
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(temp, sizeof(temp), "Name: %s(%d)\n",PlayerName(ID),ID);
strcat(info, temp);
format(temp, sizeof(temp), "Score: %i\n",GetPlayerScore(ID));
strcat(info, temp);
format(temp, sizeof(temp), "Cash: %d$\n",GetPlayerMoney(ID));
strcat(info, temp);
format(temp, sizeof(temp), "Bank Cash: %d$\n",BankCash[ID]);
strcat(info, temp);
format(temp, sizeof(temp), "Admin Level: %d\n",AdminLevel[ID]);
strcat(info, temp);
format(temp, sizeof(temp), "Army: %d\n",CanUseArmy[ID]);
strcat(info, temp);
new variable[4];
if(CanUseCIA[playerid] == 1337) format(variable, sizeof(variable), "Yes");
else format(variable, sizeof(variable), "No");
return variable;
format(temp, sizeof(temp), "CIA: %d\n",variable);
strcat(info, temp);
format(temp, sizeof(temp), "Regular Player: %d\n",IsRegularPlayer[ID]);
strcat(info, temp);
format(temp, sizeof(temp), "Trusted Regular Player: %d\n",IsTRP[ID]);
strcat(info, temp);
format(temp, sizeof(temp), "Warns: %d\n",Warns[ID]);
strcat(info, temp);
format(temp, sizeof(temp), "Terrorist Skill: %d\n",TerroristSkill[ID]);
strcat(info, temp);
format(temp, sizeof(temp), "Rob Skill: %d\n",RobSkill[ID]);
strcat(info, temp);
format(temp, sizeof(temp), "Cop Rank: %d\n",CopRank[ID]);
strcat(info, temp);
format(temp, sizeof(temp), "Has C4: %d\n",HasC4[ID]);
strcat(info, temp);
format(temp, sizeof(temp), "Secure Wallet: %d\n",HasSecureWallet[ID]);
strcat(info, temp);
format(temp, sizeof(temp), "Condoms: %d\n",HasCondoms[ID]);
strcat(info, temp);
format(temp, sizeof(temp), "Ropes: %d\n",HasRope[ID]);
strcat(info, temp);
format(temp, sizeof(temp), "Scissors: %d\n",HasScissors[ID]);
strcat(info, temp);
format(temp, sizeof(temp), "Kills: %d\n",Kills[ID]);
strcat(info, temp);
format(temp, sizeof(temp), "Deaths: %d\n",Deaths[ID]);
strcat(info, temp);
ShowPlayerDialog(playerid,DIALOG_STATS, DIALOG_STYLE_MSGBOX,"{53C506}Stats",info,"Close","");
return true;
}
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 079: inconsistent return types (array & non-array)
D:\Games\SFCRRPGv1.1\Best\gamemodes\SFCRRPG.pwn(5721) : error 079: inconsistent return types (array & non-array)
D:\Games\SFCRRPGv1.1\Best\gamemodes\SFCRRPG.pwn(5746) : warning 225: unreachable code
D:\Games\SFCRRPGv1.1\Best\gamemodes\SFCRRPG.pwn(5789) : error 079: inconsistent return types (array & non-array)
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
if(CanUseCIA[playerid] == 1337) format(variable, sizeof(variable), "Yes"); else format(variable, sizeof(variable), "No"); return variable;
if(CanUseCIA[playerid] == 1337) format(variable, sizeof(variable), "Yes"); else format(variable, sizeof(variable), "No");
new ID; new Float:gihp, Float:giar; GetPlayerHealth(ID, gihp); GetPlayerArmour(ID, giar); GetPlayerWantedLevel(ID); new temp[1000]; new info[1000]; if(sscanf(params, "u", ID)) { SendClientMessage(playerid,COLOR_ERROR,"USAGE: /tinfo (Player Name/ID)"); return 1; }
new ID; new Float:gihp, Float:giar; new temp[1000]; new info[1000]; if(sscanf(params, "u", ID)) { SendClientMessage(playerid,COLOR_ERROR,"USAGE: /tinfo (Player Name/ID)"); return 1; } GetPlayerHealth(ID, gihp); GetPlayerArmour(ID, giar); GetPlayerWantedLevel(ID);
new temp[1000]; new info[1000];
if(CanUseCIA[playerid] == 1337) format(temp, sizeof(temp), "Yes"); else format(temp, sizeof(temp), "No"); strcat(info, temp); // you miss this,
#define Y(%0) ((%0) ? 1 : 0)
GetPlayerStats(user)
{
new str[1000];
static const YesOrNo[][] = {"No","Yes"};
new Score = GetPlayerScore(user);
new Cash = GetPlayerMoney(user);
new Lvl = AdminLevel[user];
new Army = CanUseArmy[user];
new CIA = CanUseCIA[user];
new RegPla = IsRegularPlayer[user];
new Trust = IsTRP[user];
new C4 = HasC4[user];
new Wallet = HasSecureWallet[user];
new Con = HasCondoms[user];
new Rope = HasRope[user];
new Sci = HasScissors[user];
new Kill = Kills[user];
new Dead = Deaths[user];
format(str, sizeof(str), "Name: %s(%d)\nScore: %d\nCash: %d$\nAdmin Level: %d\n\
Army: %s\nCIA: %s\nRegular Player: %s\nTrusted Regular Player: %s\nWarns: %d\n\
Terrorist Skill: %d\nRob Skill: %d\nCop Rank: %d\nHas C4: %s\nSecure Wallet: %s\n\
Condoms: %s\nRopes: %s\nScissors: %s\nKills: %d\nDeaths: %d",
PlayerName(user),user,Score,Cash,Lvl,YesOrNo[Y(Army)],YesOrNo[Y(CIA)],
YesOrNo[Y(RegPla)],YesOrNo[Y(Trust)],Warns[user],TerroristSkill[user],
RobSkill[user],CopRank[user],YesOrNo[Y(C4)],YesOrNo[Y(Wallet)],
YesOrNo[Y(Con)],YesOrNo[Y(Rope)],YesOrNo[Y(Sci)],Kill,Dead);
return str;
}
dcmd_stats(playerid,params[])
{
#pragma unused params
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;
}
new string[128];
ShowPlayerDialog(playerid,DIALOG_STATS, DIALOG_STYLE_MSGBOX,"{53C506}Stats",GetPlayerStats(playerid),"Close","");
format(string,sizeof(string),"[ADMIN SPY] %s(%d) has typed /stats.",PlayerName(playerid),playerid);
SendClientMessageToAllAdmins(string);
return true;
}