invalid function or declaration NEED HELP -
Killer786 - 02.11.2011
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.
Re: invalid function or declaration NEED HELP -
Norn - 02.11.2011
Where's the rest of the callback?
Re: invalid function or declaration NEED HELP -
SmiT - 02.11.2011
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;
}
Re: invalid function or declaration NEED HELP -
Killer786 - 02.11.2011

THANKS
Re: invalid function or declaration NEED HELP - array13 - 02.11.2011
PHP код:
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;
}
else if (strcmp("/skcr", cmdtext, true, 10) == 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