Help with #define
#1

Ok sa I'm trying to make a /status script and I got a problem at the Faction part.

So I'm using YSI to save my accounts, on the player register they'll be automatically seted in the "Middlers" team

PHP код:
#define Middler 5 //Civilans
#define Havoc 6 // Havoc 
PHP код:
gTeam[playerid] = Middler
to skip any other useless words I'll say it directly. When the player types /status at Faction he sees the ID of the faction I defined and not the faction name. Is there any way to change that ID to with the original name or with a name? I mean can I #define Middlers "Middlers" or something like that?
Reply
#2

Hmm...
Why you wont use INI, to save faction information?

Anyways..
Show us the /status command.

pawn Код:
format(Middler, 32, "Civillian")
format(Havoc, 32, "Havoc");
Reply
#3

PHP код:
if (strcmp("/status"cmdtexttrue10) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
        new 
name[MAX_PLAYER_NAME+1];
        
GetPlayerName(playeridnamesizeof(name));
        new 
string1[128],stats[1024];
            
format(string1,sizeof(string1),"Nume:%s\nSkill:%d\nBani:%d\nFactiune:%d",name,PlayerInfo[playerid][wSkill],PlayerInfo[playerid][pCash],gTeam[playerid]);
            
format(statssizeof stats"%s"string1);
            
ShowPlayerDialog(playerid,3,DIALOG_STYLE_MSGBOX,"Your account:",stats,"Ok","");
            }
    } 
Here's the command Nume = Name, Bani = Money and Factiune = Faction
Reply
#4

Not tested.


pawn Код:
if (strcmp("/status", cmdtext, true, 10) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
        new name[MAX_PLAYER_NAME+1];
        GetPlayerName(playerid, name, sizeof(name));
        new string1[128],stats[1024];
        new facname[32];
            if(gTeam[playerid] == 1) format(facname, 32, "Civillian");
            if(gTeam[playerid] == 2) format(facname, 32, "Havoc");
            format(string1,sizeof(string1),"Nume:%s\nSkill:%d\nBani:%d\nFactiune:%d",name,PlayerInfo[playerid][wSkill],PlayerInfo[playerid][pCash],facname);
            format(stats, sizeof stats, "%s", string1);
            ShowPlayerDialog(playerid,3,DIALOG_STYLE_MSGBOX,"Your account:",stats,"Ok","");
            }
    }
Reply
#5

Nevermind I edited some points and everything is working just fine. Thank you for the fast reply. +Rep
Reply
#6

Oh yes, My bad.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)