OnPlayerCommandPerformed question
#1

Hey, if for example, under OnPlayerCommandReceived, I do something like this:

PHP код:
public OnPlayerCommandReceived(playeridcmdtext[])
{
    if(!
PlayerInfo[playerid][pLoggedIn])
    {
        
SendClientMessage(playeridCOLOR_RED"You have to login in order to perform commands.");
        return 
0;
    }
    return 
1;

Would the "return 0" call the function OnPlayerCommandPerformed ?
Reply
#2

pLoggedIn is a bool make it
PHP код:
if(PlayerInfo[playerid][pLoggedIn] == false)
{
    
SendClientMessage(playeridCOLOR_RED"You have to login in order to perform commands.");
    return 
0;
}
return 
1
Reply
#3

Quote:
Originally Posted by Gotham
Посмотреть сообщение
pLoggedIn is a bool make it
PHP код:
if(PlayerInfo[playerid][pLoggedIn] == false)
{
    
SendClientMessage(playeridCOLOR_RED"You have to login in order to perform commands.");
    return 
0;
}
return 
1
I pressume you didn't understand the question
Reply
#4

I think return 0; would do it :P
Reply
#5

Quote:
Originally Posted by Gotham
Посмотреть сообщение
pLoggedIn is a bool make it
PHP код:
if(PlayerInfo[playerid][pLoggedIn] == false)
{
    
SendClientMessage(playeridCOLOR_RED"You have to login in order to perform commands.");
    return 
0;
}
return 
1
Same thing.
O.T.: returning 0 in OnPlayerCommandReceived causes the command to not perform. So, logically that would result in the callback not being called.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)