PDA

View Full Version : Help| after GMX .. (+REP)


_DownLoaD_
02/03/2012, 03:10 PM
i maked a Tag System in dini.

New:
new PlayerTag[MAX_PLAYERS][MAX_STRING]
;
OnPlayerConnect:
PlayerTag[playerid] = dini_Get(PlayerFile(playerid),"Tag");
OnPlayerDisConnect:
dini_Set(PlayerFile(playerid),"Tag",PlayerTag[playerid]);
OnPlayerText:
if(dini_Int(PlayerFile(playerid),"HaveTag") == 1){
format(Text,sizeof(Text),"%s {FFFFFF}[id: %d | %s{FFFFFF}]",ColouredText(text),playerid,ColouredText(PlayerTa g[playerid]));
SendPlayerMessageToAll(playerid,Text);
return 0;
}
SettaG Command:
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 | ]

_DownLoaD_
02/03/2012, 03:49 PM
HELP?

Michael@Belgium
02/03/2012, 05:33 PM
I would recommend not to use /gmx. Just restart the whole server. It's better, and it's the same though.

Walsh
02/03/2012, 09:57 PM
Make a loop under OnGameModeExit to loop through all the players and save the stats under OnGameModeExit too.

R0FLC0PTER
02/03/2012, 10:06 PM
Try moving the dini set in onplayerdisconnect to the command.
So when someone changes tag, it saves right away

_DownLoaD_
03/03/2012, 06:48 AM
I did:
for(new i = 0; i < MAX_PLAYERS; i++) { dini_Set(PlayerFile(i),"Tag",PlayerTag[i]); }

doesnt help.

suhrab_mujeeb
03/03/2012, 07:04 AM
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.

_DownLoaD_
03/03/2012, 07:23 AM
doesnt working, nevermind i will just leave it and use normal dini_Int.
all of you get REP for trying help me ;]

R0FLC0PTER
03/03/2012, 07:39 AM
Ok, I'm sorry you couldn't find the solution.
But thx for the rep anyway.