Problem with Learning Tuto again
#1

Hi , i use /learn {playerid] so , the player get Punished and must Learn again the tutorial, but , whene i do it , the player Connect IG and doesn't Learn the tutorial...

Command :
pawn Код:
if(strcmp(cmd, "/learn", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /learn [playerid/PartOfName]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if (PlayerInfo[playerid][pAdmin] >= 3)
            {
                if(IsPlayerConnected(giveplayerid))
                {
                    if(giveplayerid != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        new year, month,day;
                        getdate(year, month, day);
                        format(string, sizeof(string), "%s was been Kicked by %s, He Must Learn again the Tutorial(NoRP).(%d-%d-%d)", sendername,giveplayer,day,month,year);
                        KickLog(string);
                        PlayerInfo[playerid][pTut] = 0;//This is the expression i use
                        format(string, sizeof(string), "An Admin Forced you to learn the tutorial Again.");
                        SendClientMessage(giveplayerid,COLOR_LIGHTRED,string);
                        Kick(giveplayerid);
                        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, 256, "%s kicked %s (Must Learn the tutorial).", sendername,giveplayer);
                        SendClientMessageToAll(COLOR_LIGHTRED, string);
                        return 1;
                    }
                }
            }
            else
            {
                format(string, sizeof(string), "the ID %d is not avaible.", giveplayerid);
                SendClientMessage(playerid, COLOR_GRAD1, string);
            }
        }
        return 1;
    }
I use :
PHP код:
PlayerInfo[playerid][pTut] = 0
Reply
#2

Shouldn't it be
pawn Код:
PlayerInfo[playerid][pTut] = 0;
Also are you sure that you are saving it in the user file?
Reply
#3

Are you sure that when a players connect you check if the pTut is 0 and if it is you make it 1 and force him the tutorial ?
Reply
#4

0= Has not learned the Tuto
1=Has Done it

@Berlovan : No i don't have it on : Public onplayerconnect
Reply
#5

Well then I suggest you check when player connects that if the tutorial = 0 put tutorial = 1 and FORCE him on the tutorial!
Reply
#6

You don't save the pTut to userfile before you kick.
Reply
#7

The Problem is How to Force him ?
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)