SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 02/03/2012, 03:10 PM   #1
_DownLoaD_
Big Clucker
 
Join Date: Jun 2011
Posts: 153
Reputation: 4
Default Help| after GMX .. (+REP)

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 | ]
_DownLoaD_ is offline   Reply With Quote
Old 02/03/2012, 03:49 PM   #2
_DownLoaD_
Big Clucker
 
Join Date: Jun 2011
Posts: 153
Reputation: 4
Default Re: Help| after GMX .. (+REP)

HELP?
_DownLoaD_ is offline   Reply With Quote
Old 02/03/2012, 05:33 PM   #3
Michael@Belgium
High-roller
 
Michael@Belgium's Avatar
 
Join Date: Dec 2010
Location: Belgium
Posts: 1,768
Reputation: 1001
Default Re: Help| after GMX .. (+REP)

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

Need host-tab ? Contact me on discord^

sO aCtIvE
You last visited: 11/01/2018 at 11:21 PM
You last visited: 09/10/2018 at 08:30 PM
Michael@Belgium is offline   Reply With Quote
Old 02/03/2012, 09:57 PM   #4
Walsh
Big Clucker
 
Walsh's Avatar
 
Join Date: Feb 2012
Posts: 189
Reputation: 5
Default Re: Help| after GMX .. (+REP)

Make a loop under OnGameModeExit to loop through all the players and save the stats under OnGameModeExit too.
__________________
Walsh is offline   Reply With Quote
Old 02/03/2012, 10:06 PM   #5
R0FLC0PTER
Little Clucker
 
Join Date: Feb 2012
Location: Netherlands, The
Posts: 44
Reputation: 14
Default Re: Help| after GMX .. (+REP)

Try moving the dini set in onplayerdisconnect to the command.
So when someone changes tag, it saves right away
R0FLC0PTER is offline   Reply With Quote
Old 03/03/2012, 06:48 AM   #6
_DownLoaD_
Big Clucker
 
Join Date: Jun 2011
Posts: 153
Reputation: 4
Default Re: Help| after GMX .. (+REP)

I did:
PHP Code:
for(new 0MAX_PLAYERSi++) { dini_Set(PlayerFile(i),"Tag",PlayerTag[i]); } 
doesnt help.
_DownLoaD_ is offline   Reply With Quote
Old 03/03/2012, 07:04 AM   #7
suhrab_mujeeb
Guest
 
Posts: n/a
Default Re: Help| after GMX .. (+REP)

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 With Quote
Old 03/03/2012, 07:23 AM   #8
_DownLoaD_
Big Clucker
 
Join Date: Jun 2011
Posts: 153
Reputation: 4
Default Re: Help| after GMX .. (+REP)

doesnt working, nevermind i will just leave it and use normal dini_Int.
all of you get REP for trying help me ;]
_DownLoaD_ is offline   Reply With Quote
Old 03/03/2012, 07:39 AM   #9
R0FLC0PTER
Little Clucker
 
Join Date: Feb 2012
Location: Netherlands, The
Posts: 44
Reputation: 14
Default Re: Help| after GMX .. (+REP)

Ok, I'm sorry you couldn't find the solution.
But thx for the rep anyway.
R0FLC0PTER is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 07:38 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.