invalid function and 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: invalid function and declaration (
/showthread.php?tid=205293)
invalid function and declaration -
Hudgens - 01.01.2011
Okay been nugging on this for a long time now and it's getting on my mind lol + Im really tired..
Anyways I'm making a couple of commands after and it's a couple of commands.
Trying to make a teleport to skatepark and I get this error
Код:
TDM.pwn(219) : warning 217: loose indentation
TDM.pwn(236) : error 010: invalid function or declaration
TDM.pwn(239) : error 010: invalid function or declaration
TDM.pwn(241) : error 010: invalid function or declaration
Don't you really need to return the value to 0
Here's the code including the code before, might be easier to localize the error.
Код:
}
if (strcmp("/Basejump", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid,1544.3617,-1355.5189,329.4706);
SetPlayerInterior(playerid,0);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,46,1);
SetPlayerSkin(playerid,167);
SendClientMessage(playerid, COLOR_YELLOW, "Are you to chicken to jump eh?");
return 1;
}
if (strcmp("/Skydive", cmdtext, true, 10) == 0)
SetPlayerPos(playerid,1629.8702,-1506.6764,801.8223);
SetPlayerInterior(playerid,0);
GivePlayerWeapon(playerid,46,1);
SendClientMessage(playerid, COLOR_YELLOW,"Here you go!");
return 1;
}
if (strcmp("/Skatepark", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid,1928.8933,-1397.9685,13.5703);
return 1;
}
return 0;
}
Yes. as you understood I am a noob

.
Re: invalid function and declaration - Larsey123IsMe - 01.01.2011
Try this:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/Basejump", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid,1544.3617,-1355.5189,329.4706);
SetPlayerInterior(playerid,0);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,46,1);
SetPlayerSkin(playerid,167);
SendClientMessage(playerid, COLOR_YELLOW, "Are you to chicken to jump eh?");
return 1;
}
if (strcmp("/Skydive", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid,1629.8702,-1506.6764,801.8223);
SetPlayerInterior(playerid,0);
GivePlayerWeapon(playerid,46,1);
SendClientMessage(playerid, COLOR_YELLOW,"Here you go!");
return 1;
}
if (strcmp("/Skatepark", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid,1928.8933,-1397.9685,13.5703);
return 1;
}
return 0;
}
Re: invalid function and declaration -
Hudgens - 01.01.2011
Yup, it worked, just got 2 indentation errors but nothing big I solve that later. Thanks mate.