Exit Help
#1

why doesent this unfreeze me when i type /exit??


PHP код:
      if(strcmp(cmd"/exit"true) == 0)
                    {
                    
TogglePlayerControllable(playerid1);
                    return 
1;
                    } 
Reply
#2

pawn Код:
if(strcmp(cmd, "/exit", true) == 0)
{
    TogglePlayerControllable(playerid, true);
    return 1;
}
Reply
#3

Quote:
Originally Posted by clarencecuzz
Посмотреть сообщение
pawn Код:
if(strcmp(cmd, "/exit", true) == 0)
{
    TogglePlayerControllable(playerid, true);
    return 1;
}
true = 1 already

by Default
pawn Код:
if (strcmp("/exit", cmdtext, true, 10) == 0)
    {
        TogglePlayerControllable(playerid, 1);
        return 1;
    }
Reply
#4

edit Nevermind.
Reply
#5

It is same


Код:
TogglePlayerControllable(playerid, 1);  == TogglePlayerControllable(playerid, true);
Reply
#6

Quote:
Originally Posted by Matz
Посмотреть сообщение
true = 1 already

by Default
pawn Код:
if (strcmp("/exit", cmdtext, true, 10) == 0)
    {
        TogglePlayerControllable(playerid, 1);
        return 1;
    }
I know it is the same... but you should use 'true' to help reduce confusion between 0 and 1 and what they stand for.
Oh and... it shouldn't be 10... /exit is only 5 characters long...
pawn Код:
if(strcmp(cmdtext, "/exit", true, 5) == 0)
would be the correct syntax.
Reply
#7

PHP код:
if(strcmp(cmdtext"/exit"true5) == 0)
                      {
                          
GetPlayerName(playeridsendernamesizeof(sendername));
                          
TogglePlayerControllable(playerid1);
                          return 
1;
                     } 
Like this?cause non from above dont work
Reply
#8

does anyone know??
Reply
#9

Just try this:
Код:
if( strcmp( cmdtext, "/exit", true ) == 0 )
{
    TogglePlayerControllable( playerid, true );
    return 1;
}
It is very possible to don't be called, maybe it is in a FS, and in OnPlayerCommandText in GM you return 1; . Better put this command in your GM.
Reply
#10

Try using a timer

Add this below

pawn Код:
main()
{
print(etc...
}
pawn Код:
forward ExitTimer(playerid);
public ExitTimer(playerid)
{
TogglePlayerControllable(playerid, 1);
return 1;
}
then in /exit cmd

pawn Код:
if(strcmp(cmdtext, "/exit", true, 5) == 0)
{
SetTimer("ExitTimer", 3000, false); // 3 seconds in milliseconds you will be unfrozen
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)