A little help please.
#1

I got this
pawn Код:
else if(GetPVarInt(playerid, "RegistrationStep") == 9)
           {
               new idx;
               tmp = strtok(text, idx);
               if((strcmp("1", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("1")))
               {
                   
                   ClearChatbox(playerid, 5);
                   SendClientMessage(playerid, COLOR_LIGHTRED, "___________________________________");
                   SendClientMessage(playerid, COLOR_YELLOW2, "Please make sure to read /rules for Server Rules.");
                   SendClientMessage(playerid, COLOR_YELLOW2, "If you break any of those rules ingame, You could be banned or jailed or forced to retake tutorial");
                   SendClientMessage(playerid, COLOR_YELLOW2, "So make sure to read the /rules to stay inside this server!.");
                   SendClientMessage(playerid, COLOR_LIGHTRED, "___________________________________");
                   SendClientMessage(playerid, COLOR_WHITE, "End of Roleplay test");
                   GameTextForPlayer(playerid, "~g~ Welcome to Project Reality Roleplay Server.", 5000, 3);
                   SetPVarInt(playerid, "RegistrationStep", 0);
                   PlayerInfo[playerid][pTut] = 1;
                   SetTimerEx("Tutorial", 0000, false, "i", playerid);
               }
               else
               {
                   SendClientMessage(playerid,COLOR_LIGHTRED,"[SERVER]: You have been kicked for giving the wrong answer.");
                   Kick(playerid);
               }
               return 0;
        }
        return 0;
    }
ANd if im not mistaken ( still learning )

pawn Код:
if((strcmp("1", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("1")))
This will see if the player typed 1

And this
pawn Код:
PlayerInfo[playerid][pTut] = 1;
Will save 1 to the variable, after the player types 1

The thing is that i want it to save dirrectly without waiting for the player to type 1, How can i do that,?

Thanks in advance
Reply
#2

Quote:
Originally Posted by Jaber_Brown
Посмотреть сообщение
pawn Код:
if((strcmp("1", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("1")))
It's good but slow. Better use this way if you want to check only one char/letter:
pawn Код:
if(tmp[0]=='1')
Quote:
Originally Posted by Jaber_Brown
Посмотреть сообщение
pawn Код:
PlayerInfo[playerid][pTut] = 1;
Will save 1 to the variable, after the player types 1
In this case yes. (because it's inside of 'if' )

Quote:
Originally Posted by Jaber_Brown
Посмотреть сообщение
The thing is that i want it to save dirrectly without waiting for the player to type 1, How can i do that,?
The changes needs to be in "RegistrationStep" 8.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)