commands works but also returns "unknown command"
#3

Quote:
Originally Posted by OmeRinG
This is weird as it seems you were doing the code alright, try this instead:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp(cmdtext,"/makemehappy",true))
    {
     SetPlayerHealth(playerid, 100);
     GivePlayerMoney(playerid,1000000);
     return 1;
    }
    return SendClientMessage(playerid,0xffffffff,"I don't know this command.");
}
And tell me if it says "I don't know this command" or it keeps saying "Unknown command"
it works now! thanks

when i type an invalid command it returns "i don't know this command."

and when i type the valid command, it does as supposed to, without anything else

Edit:

While i'm on it, how do i make an if statement telling if the player is in a vehicle or not?

i tried with:
Код:
if(!IsPlayerInAnyVehicle(playerid);)return 1;
{
	//code
}
else
{
	//code
}
but it didn't work :/
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)