dini Team wont save after server shutdown ?
#1

FIXED!
HOW ? ok so i was using this Getplayerteam when i already had a variable set to that like gTeam so here what i did
i change pTeam to gTeam

OnPlayerDisconnect
i change it to this
PHP код:
dini_IntSet(file"Team"gTeam[playerid]); 
see gTeam

and so on for the rest like dialog_register
PHP код:
dini_IntSet(file"Team"gTeam[playerid] = 5); 
and on DIALOG_LOGIN
PHP код:
gTeam[playerid] = dini_Int(file"Team"); 
So what i am trying to say is why need a variable like pTeam or GetPlayerTeam or SetPlayerTeam when you already have gTeam[playerid] = teamid);
But thanks to all who tryed to help me +rep!
Reply
#2

Sorry, misread
EDIT:This one
pawn Код:
dini_IntSet(file, "Team", SetPlayerTeam(playerid, 5));

replace it with

dini_IntSet(file, "Team", 5);
SetPlayerTeam(playerid, 5);
Pretty sure it will work
Reply
#3

Quote:
Originally Posted by Battlezone
Посмотреть сообщение
This one
pawn Код:
dini_IntSet(file, "Team", SetPlayerTeam(playerid, 5));

replace it with

dini_IntSet(file, "Team", 5);
SetPlayerTeam(playerid, 5);
Pretty sure it will work
it dint work

oh let me try
Reply
#4

Quote:
Originally Posted by Battlezone
Посмотреть сообщение
Sorry, misread
EDIT:This one
pawn Код:
dini_IntSet(file, "Team", SetPlayerTeam(playerid, 5));

replace it with

dini_IntSet(file, "Team", 5);
SetPlayerTeam(playerid, 5);
Pretty sure it will work
nope it dint work still do same
Reply
#5

The Team number is not saving in the user file?

btw
enum pInfo
{
pTeam, <-- this one is not needed, since you can use SetPlayerTeam and GetPlayerTeam natives, so remove
}
Reply
#6

Quote:
Originally Posted by Battlezone
Посмотреть сообщение
The Team number is not saving in the user file?

btw
enum pInfo
{
pTeam, <-- this one is not needed, since you can use SetPlayerTeam and GetPlayerTeam natives, so remove
}
ok i deleted that when i register it wont even set the skin 230 ill be skin 0 cj
then when i go to city hall to select my team ill save on the scriptfiles so /q and join ill load it fine then when i /q and close the black box and turn on server box again ill not load
Reply
#7

You did copy all your code here but didn't put the most important part, Can I see your
pawn Код:
public OnPlayerDisconnect
Reply
#8

Quote:
Originally Posted by Clad
Посмотреть сообщение
You did copy all your code here but didn't put the most important part, Can I see your
pawn Код:
public OnPlayerDisconnect
PHP код:
public OnPlayerDisconnect(playeridreason

    new 
name[MAX_PLAYER_NAME], file[256]; 
    
GetPlayerName(playeridnamesizeof(name)); 
    
format(filesizeof(file), scriptfilesname); 
    if(
gPlayerLogged[playerid] == 1
    { 
        
dini_IntSet(file"HasCondom"AccountInfo[playerid][pPackCondom]); 
        
dini_IntSet(file"PackCondom",AccountInfo[playerid][pPackCondom]); 
        
dini_IntSet(file"HasPack",AccountInfo[playerid][pHasPack]); 
        
dini_IntSet(file"HasCigar",AccountInfo[playerid][pHasCigar]); // pHasCigar 
        
dini_IntSet(file"PackCigars",AccountInfo[playerid][pPackCigars]); 
        
dini_IntSet(file"PackSnack",AccountInfo[playerid][pPackSnack]); 
        
dini_IntSet(file"HasSnack",AccountInfo[playerid][pHasSnack]); 
        
dini_IntSet(file"AdminLevel",AccountInfo[playerid][pAdminLevel]); 
        
dini_IntSet(file"Money"GetPlayerMoney(playerid)); 
        
dini_IntSet(file"Score"GetPlayerScore(playerid)); 
        
dini_IntSet(file"Team"GetPlayerTeam(playerid)); 
    } 
    for(new 
0sizeof(Objects); i++) ////Xobj 
    

        if(
Player[playerid][view][i]) 
        { 
            
Player[playerid][view][i] = false
            
DestroyPlayerObject(playerid,Player[playerid][objid][i]); 
        } 
    } 
    new 
string[200]; 
    
PLAYERLIST_authed[playerid]=false
    switch(
reason
    { 
        case 
0format(string200"%s has left the server. (Timeout)"PlayerInfo(playerid)); 
        case 
1format(string200"%s has left the server. (Left)"PlayerInfo(playerid)); 
        case 
2format(string200"%s has left the server. (Kicked)"PlayerInfo(playerid)); 
    } 
    
SendClientMessageToAll(COLOR_DEADCONNECTstring); 
    
playerCheckpoint[playerid] =0
     
gPlayerLogged[playerid] = 0
    
RemoveVariables(playerid); 
    return 
1

Reply
#9

did you creating user file?

in scriptfiles or any where?
Reply
#10

Quote:
Originally Posted by IceBilizard
Посмотреть сообщение
did you creating user file?

in scriptfiles or any where?
yea

PHP код:
#define scriptfiles "/ILSRP/%s.ini" 
and DIALOG_REGISTER
PHP код:
format(filesizeof(file), scriptfilesname); 
DIALOG_LOGIN
PHP код:
format(filesizeof(file), scriptfilesname); 
this the user .ini
PHP код:
Password=232129203
HasCondom
=0
PackCondom
=0
HasCigar
=0
HasPack
=0
PackSnack
=0
AdminLevel
=0
PackCigars
=0
HasSnack
=0
Money
=1500
Score
=1
Team
=
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)