About stats command.... (need help)
#1

So here is my stats command and it giving errors:
pawn Код:
(649) : error 029: invalid expression, assumed zero
(649) : warning 215: expression has no effect
(649) : error 001: expected token: ";", but found ")"
(649) : error 029: invalid expression, assumed zero
(649) : fatal error 107: too many error messages on one line
And here is cmd
pawn Код:
YCMD:stats(playerid,params[],help)
{
    if(IsPlayerConnected(playerid))
    {
        new Passw = pInfo[playerid][Pass];
        new Admins = pInfo[playerid][Admin];
        new Vips = pInfo[playerid][Vip];
        new Respects = pInfo[playerid][Respect];
        new Moneys = pInfo[playerid][Money];
        new Killss = pInfo[playerid][Kills];
        new Deathss = pInfo[playerid][Deaths];
        new Arresteds = pInfo[playerid][Arrested];
        new Jaileds = pInfo[playerid][Jailed];
        new Kickeds = pInfo[playerid][Kicked];
        new Banneds = pInfo[playerid][Banned];
        new Joineds = pInfo[playerid][Joined];
        new Members = pInfo[playerid][Member];
        new Leaders = pInfo[playerid][Leader];
        new Houses = pInfo[playerid][House];
        new Cars = pInfo[playerid][Car];
        new Keyss = pInfo[playerid][Keys];
        new Keys1s = pInfo[playerid][Keys1];
        new Keys2s = pInfo[playerid][Keys2];
        new Keys3s = pInfo[playerid][Keys3];
        new Keys4s = pInfo[playerid][Keys4];
        new Warneds = pInfo[playerid][Warned];
        new Tickets = pInfo[playerid][Ticket];
        new JoinedEvents = pInfo[playerid][JoinedEvent];
        new Cookies = pInfo[playerid][Cookie];
        new Skins = pInfo[playerid][Skin];
        new Citys = pInfo[playerid][City];
        new Scoress = pInfo[playerid][Scores];
        new Fightings = pInfo[playerid][Fighting];
        new Ages = pInfo[playerid][Age];
        new Religions = pInfo[playerid][Religion];
        new Educations = pInfo[playerid][Education];
        new string[500];
        format(string,sizeof(string),"Password: %s | Admin: %d | Vip: %d | Respect: %d | Money: %d | Kills: %d | Deaths: %d |",Passw,Admins,Vips,Respects,Moneys,Killss,Deathss);
        format(string,sizeof(string),"Arrested: %d | Jailed: %d | Kicked: %d| Banned: %d| Joined: %d| Member: %d| Leader: %d|",Arresteds,Jaileds,Kickeds,Banneds,Joineds,Members,Leaders);
        format(string,sizeof(string),"House: %d| Car: %d| Key: %d| Key1: %d| Key2: %d| Key3: %d| Key4: %d| Events: %d| Warns: %d| Tickets: %d| Cookies: %d|",Houses,Cars,Keyss,Keys1s,Keys2s,Keys3s,Keys4s,JoinedEvents,Warneds,Tickets,Cookies);
        format(string,sizeof(string),"Skin: %d| City: %d| Scores: %d| Fighting: %d| Age: %d| Religion: %d| Education: %d|",Skins,Citys,Scoress,Fightings,Ages,Religions,Educations);
        SendClientMessage(playerid,COLOR_WHITE,string);//This line is giving errors...
    }
    return 1;
}
Thought what could be wronk more then 2 h but cant think nothing out...
Reply
#2

Which of those stats is line 649? Edit: didn't see that you wrote which line...
Reply
#3

COLOR_WHIT 0xFFFFFFAA

Wasn't defined correctly. My foult.. And another question how can I get out from:

Код:
pInfo[playerid][Fighting] = 1;
Correct fighting style. Like when player write /stats it shows Fighting: Normal
Reply
#4

I'm sorry but I don't see anything wrong in that command. Is there anything else related to that command that could cause it?
Reply
#5

COLOR_WHIT 0xFFFFFFAA

Wasn't defined correctly. My foult.. And another question how can I get out from:

Code:

pInfo[playerid][Fighting] = 1;

Correct fighting style. Like when player write /stats it shows Fighting: Normal

And another thing /stats shows only last line of code....
Reply
#6

Stats only shows the last line of code because that's the only one that is sent since you've only got one SendClientMessage. Put one SendClientMessage after every format and it should work.
Reply
#7

Okay thanks And for second question? Do you have some thought how to do it?

Worked as charm.. But now one thing how to unhash passwod.. I'm currently useing whirpool so need to unhash to show in player stats true password.
Reply
#8

So the pInfo[playerid][Fighting] is norml style when it's 1? And you want it to say Fightinstyle: normal instead of Fightingstyle: 1 in the /stats command?

I have to say that I have never done it before but I tried anyways



On the top of the script:

Код:
 new fightingstyles[1][] = {
{"Normal"}};
You can add more fightingstyle names as long as you increase the array.


Insert this where your fighting style integer in the stats string is: fightingstyles[pInfo[playerid][Fighting]-1

I haven't compiled this but it should work as it is if you do this.


Код:
YCMD:stats(playerid,params[],help)
{
    if(IsPlayerConnected(playerid))
    {
        new Passw = pInfo[playerid][Pass];
        new Admins = pInfo[playerid][Admin];
        new Vips = pInfo[playerid][Vip];
        new Respects = pInfo[playerid][Respect];
        new Moneys = pInfo[playerid][Money];
        new Killss = pInfo[playerid][Kills];
        new Deathss = pInfo[playerid][Deaths];
        new Arresteds = pInfo[playerid][Arrested];
        new Jaileds = pInfo[playerid][Jailed];
        new Kickeds = pInfo[playerid][Kicked];
        new Banneds = pInfo[playerid][Banned];
        new Joineds = pInfo[playerid][Joined];
        new Members = pInfo[playerid][Member];
        new Leaders = pInfo[playerid][Leader];
        new Houses = pInfo[playerid][House];
        new Cars = pInfo[playerid][Car];
        new Keyss = pInfo[playerid][Keys];
        new Keys1s = pInfo[playerid][Keys1];
        new Keys2s = pInfo[playerid][Keys2];
        new Keys3s = pInfo[playerid][Keys3];
        new Keys4s = pInfo[playerid][Keys4];
        new Warneds = pInfo[playerid][Warned];
        new Tickets = pInfo[playerid][Ticket];
        new JoinedEvents = pInfo[playerid][JoinedEvent];
        new Cookies = pInfo[playerid][Cookie];
        new Skins = pInfo[playerid][Skin];
        new Citys = pInfo[playerid][City];
        new Scoress = pInfo[playerid][Scores];
        new Fightings = pInfo[playerid][Fighting];
        new Ages = pInfo[playerid][Age];
        new Religions = pInfo[playerid][Religion];
        new Educations = pInfo[playerid][Education];
        new string[500];
        format(string,sizeof(string),"Password: %s | Admin: %d | Vip: %d | Respect: %d | Money: %d | Kills: %d | Deaths: %d |",Passw,Admins,Vips,Respects,Moneys,Killss,Deathss);
        format(string,sizeof(string),"Arrested: %d | Jailed: %d | Kicked: %d| Banned: %d| Joined: %d| Member: %d| Leader: %d|",Arresteds,Jaileds,Kickeds,Banneds,Joineds,Members,Leaders);
        format(string,sizeof(string),"House: %d| Car: %d| Key: %d| Key1: %d| Key2: %d| Key3: %d| Key4: %d| Events: %d| Warns: %d| Tickets: %d| Cookies: %d|",Houses,Cars,Keyss,Keys1s,Keys2s,Keys3s,Keys4s,JoinedEvents,Warneds,Tickets,Cookies);
        format(string,sizeof(string),"Skin: %d| City: %d| Scores: %d| Fighting: %d| Age: %d| Religion: %d| Education: %d|",Skins,Citys,Scoress,fightingstyles[pInfo[playerid][Fighting]-1],Ages,Religions,Educations);
        SendClientMessage(playerid,COLOR_WHITE,string);//This line is giving errors...
    }
    return 1;
}
Tell me if it gives errors.


If the current doesn't work it's fightingstyles[pInfo[playerid][Fighting-1]]
Reply
#9

Quote:
Originally Posted by Scrillex
Посмотреть сообщение
Okay thanks And for second question? Do you have some thought how to do it?

Worked as charm.. But now one thing how to unhash passwod.. I'm currently useing whirpool so need to unhash to show in player stats true password.
I'm sorry, I haven't been using whirlpool so I'm afraid I can't help you now.
Reply
#10

pawn Код:
(652) : error 001: expected token: "]", but found ","
(641) : warning 204: symbol is assigned a value that is never used: "Fightings"
pawn Код:
652 : format(string,sizeof(string),"Skin: %d| City: %d| Scores: %d| Fighting: %d| Age: %d| Religion: %d| Education: %d|",Skins,Citys,Scoress,fightingstyles[pInfo[playerid][Fighting]-1,Ages,Religions,Educations);


641 : new Fightings = pInfo[playerid][Fighting];
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)