invalid function or declaration NEED HELP
#1

please i need help..........

Код:
public OnPlayerCommandText(playerid, cmdtext[])

	if (strcmp("/city", cmdtext, true, 10) == 0)
        {
				SetPlayerPos(playerid, -2912.19921875,-985,11);
                GameTextForPlayer(playerid, "Drive Slowly",5000,5);
                return 1;
        }


	if (strcmp("/skcr", cmdtext, true, 10) == 0)
        {
				SetPlayerPos(playerid, -2516.3000488281,-1111.0999755859,991.20001220703);
                GameTextForPlayer(playerid, "Sky Cage Road",5000,5);
i need help

Код HTML:
G:\....\gamemodes\1.pwn(430) : warning 209: function "OnPlayerCommandText" should return a value
G:\....gamemodes\1.pwn(430) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#2

Where's the rest of the callback?
Reply
#3

For the warning, it tells you that you should return a value to "OnPlayerCommandText" e.g: false. For the error, you forget to open a block for the "OnPlayerCommandText" callback.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/city", cmdtext, true, 10) == 0)
    {
        SetPlayerPos(playerid, -2912.19921875,-985,11);
        GameTextForPlayer(playerid, "Drive Slowly",5000,5);
        return 1;
    }
    if (strcmp("/skcr", cmdtext, true, 10) == 0)
    {
        SetPlayerPos(playerid, -2516.3000488281,-1111.0999755859,991.20001220703);
        GameTextForPlayer(playerid, "Sky Cage Road",5000,5);
    }
    return false;
}
Reply
#4

THANKS
Reply
#5

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/city"cmdtexttrue10) == 0)
    {
        
SetPlayerPos(playerid, -2912.19921875,-985,11);
        
GameTextForPlayer(playerid"Drive Slowly",5000,5);
        return 
1;
    }
    else if (
strcmp("/skcr"cmdtexttrue10) == 0)
    {
        
SetPlayerPos(playerid, -2516.3000488281,-1111.0999755859,991.20001220703);
        
GameTextForPlayer(playerid"Sky Cage Road",5000,5);
    }
    return 
false;

i always use else if on the strcmp, but i suggest you to use zcmd
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)