error 010: invalid function or declaration - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: error 010: invalid function or declaration (
/showthread.php?tid=635330)
error 010: invalid function or declaration -
Ilias_ - 05.06.2017
My code is
Код:
public OnPlayerCommandText(playerid,cmdtext[])
if (!strcmp("/racetrack",cmdtext,true))
{
SetPlayerInterior(playerid,0);
if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
LinkVehicleToInterior(GetPlayerVehicleID(playerid),0);
SetVehiclePos(GetPlayerVehicleID(playerid),-521.0,-3643.0,7.0);
SetVehicleZAngle(GetPlayerVehicleID(playerid),0.0);
}
else
{
SetPlayerPos(playerid,-521.0,-3643.0,7.0);
SetPlayerFacingAngle(playerid,0.0);
}
return 1;
}
and i am getting the error error 010: invalid function or declaration
Re: error 010: invalid function or declaration -
skuller12 - 05.06.2017
if(strcmp(cmd, "/racetrack", true) == 0)
Re: error 010: invalid function or declaration -
Ilias_ - 05.06.2017
Quote:
Originally Posted by skuller12
if(strcmp(cmd, "/racetrack", true) == 0)
|
didnt works
Re: error 010: invalid function or declaration -
MrFantasy - 05.06.2017
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/racetrack", cmdtext, true, 10) == 0)
{
SetPlayerInterior(playerid,0);
if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
LinkVehicleToInterior(GetPlayerVehicleID(playerid),0);
SetVehiclePos(GetPlayerVehicleID(playerid),-521.0,-3643.0,7.0);
SetVehicleZAngle(GetPlayerVehicleID(playerid),0.0);
}
else
{
SetPlayerPos(playerid,-521.0,-3643.0,7.0);
SetPlayerFacingAngle(playerid,0.0);
}
return 1;
}
return 0;
}
Re: error 010: invalid function or declaration -
Ilias_ - 05.06.2017
thanks it works now
Re: error 010: invalid function or declaration -
skuller12 - 05.06.2017
Top script
Код:
#define function%0(%1) forward%0(%1); public%0(%1)
And replace with code:
Код:
function OnPlayerCommandText(playerid,cmdtext[])
{
if(strcmp(cmd, "/racetrack", true) == 0)
{
SetPlayerInterior(playerid, 0);
if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
LinkVehicleToInterior(GetPlayerVehicleID(playerid),0);
SetVehiclePos(GetPlayerVehicleID(playerid),-521.0,-3643.0,7.0);
SetVehicleZAngle(GetPlayerVehicleID(playerid),0.0);
}
else
{
SetPlayerPos(playerid,-521.0,-3643.0,7.0);
SetPlayerFacingAngle(playerid,0.0);
}
return 1;
}
return 1;
}