Help| after GMX .. (+REP)
#1

i maked a Tag System in dini.

New:
PHP Code:
new    PlayerTag[MAX_PLAYERS][MAX_STRING]

OnPlayerConnect:
PHP Code:
PlayerTag[playerid] = dini_Get(PlayerFile(playerid),"Tag"); 
OnPlayerDisConnect:
PHP Code:
dini_Set(PlayerFile(playerid),"Tag",PlayerTag[playerid]); 
OnPlayerText:
PHP Code:
if(dini_Int(PlayerFile(playerid),"HaveTag") == 1){
    
format(Text,sizeof(Text),"%s {FFFFFF}[id: %d | %s{FFFFFF}]",ColouredText(text),playerid,ColouredText(PlayerTag[playerid]));
    
SendPlayerMessageToAll(playerid,Text);
    return 
0;

SettaG Command:
PHP Code:
if(strcmp(cmd,"/SetTag",true) == 0){
    
printf("[INFO]: \"%s\" Typed /SetTag",GetName(playerid));
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_WHITE,"/Help :дфчегд ма роцад боег, мтжшд дчмг");
    
tmp strtok(cmdtext,idx);
    
id strval(tmp);
    new 
length strlen(cmdtext);
    while ((
idx length) && (cmdtext[idx] <= ' '))
{
    
idx++;
}
    new 
offset idx;
    new 
result[64];
    while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
{
    
result[idx offset] = cmdtext[idx];
    
idx++;
}
    
result[idx offset] = EOS;
    new 
string2[256];
    if(!
strlen(tmp)) return SendClientMessage(playerid,COLOR_WHITE,"/SetTag [Id/Name] [Color] :щйоещ");
    if(!
IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_RED,"! дщзчп ма озебш");
    if(!
strlen(result)) return SendClientMessage(playerid,COLOR_WHITE,"/SetTag [Id/Name] [Color] :щйоещ");
    
dini_IntSet(PlayerFile(id),"HaveTag",1);
    
format(PlayerTag[id],126,"%s",result);
    
format(string,sizeof(string),"! щн мк ъав, ъъзгщ ,\"%s\" дагойп",GetName(playerid));
    
format(string2,sizeof(string2),"! \"%s\" :аъ дъав ,\"%s\" щоъ мщзчп",result,GetName(id));
    
SendClientMessage(id,COLOR_YELLOW,string);
    
SendClientMessage(playerid,COLOR_YELLOW,string2);
return 
1;

the problem is, after doing "/gmx" the tag doesn't show up.
when i text, it's like: _DownLoaD: blabla [id: 0 | ]
Reply
#2

HELP?
Reply
#3

I would recommend not to use /gmx. Just restart the whole server. It's better, and it's the same though.
Reply
#4

Make a loop under OnGameModeExit to loop through all the players and save the stats under OnGameModeExit too.
Reply
#5

Try moving the dini set in onplayerdisconnect to the command.
So when someone changes tag, it saves right away
Reply
#6

I did:
PHP Code:
for(new 0MAX_PLAYERSi++) { dini_Set(PlayerFile(i),"Tag",PlayerTag[i]); } 
doesnt help.
Reply
#7

pawn Code:
for(new i = 0; i<MAX_PLAYERS; i++) if(IsPlayerConnected(i)) OnPlayerDisconnect(i, 1);
Should go under OnGameModeExit. Same for OnGameModeInit but put OnPlayerConnect(i) instead of disconnect. Am on my phone, sorry for no indentatiobs etc.
Reply
#8

doesnt working, nevermind i will just leave it and use normal dini_Int.
all of you get REP for trying help me ;]
Reply
#9

Ok, I'm sorry you couldn't find the solution.
But thx for the rep anyway.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)