Problem with login before spawn
#1

Hi,

I have a problem.. What i have to do if i want use only /login command before spawn? Any other commands are disabled.

pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
    if (!IsPlayerSpawned(playerid))
    {
        if (strcmp(cmdtext, "/login", true))
        {
               .....
it not works because, if i type password it says i'm not spawned.
Reply
#2

show us your IsPlayerSpawned();
Reply
#3

It is not important ..

pawn Код:
stock IsPlayerSpawned(playerid)
{
    return pData[playerid][P_Spawned];
}
Reply
#4

do like this

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
   if(PlayerInfo[playerid][LoggedIn] == 0) // People use this kind of functions :P you must use your own!
   {
      SendClientMessage(playerid, COLOR_RED,"ERROR: Your not loggedin to get spawn");
      return 0;
   }
   return 1;
}

public OnPlayerCommandReceived(playerid, cmdtext[])
{
    /*if (!IsPlayerSpawned(playerid)) we dont need this
    {*/

    if (!strcmp(cmdtext, "/login", true)) // you forgot to put ! in there
    {
Reply
#5

Quote:
Originally Posted by dr.lozer
Посмотреть сообщение
do like this

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
   if(PlayerInfo[playerid][LoggedIn] == 0) // People use this kind of functions :P you must use your own!
   {
      SendClientMessage(playerid, COLOR_RED,"ERROR: Your not loggedin to get spawn");
      return 0;
   }
   return 1;
}

public OnPlayerCommandReceived(playerid, cmdtext[])
{
    /*if (!IsPlayerSpawned(playerid)) we dont need this
    {*/

    if (strcmp(cmdtext, "/login", true))
    {
We need it! Because i don't want to use other commands. In request class you can't type any commands only Login.. And that my function says you can't use any commands except /login.
Reply
#6

Quote:
Originally Posted by Channeru
blah blah blah
Ok ok now it works or not ?? see my post i edited it.. you forgot to put the ! before strcmp O.O
Reply
#7

false strcmp mean condition is right and it send message i am not spawned <- IT happens if i wouldn't type login command.
Reply


Forum Jump:


Users browsing this thread: 7 Guest(s)