invalid function and declaration
#1

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 .
Reply
#2

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;
}
Reply
#3

Yup, it worked, just got 2 indentation errors but nothing big I solve that later. Thanks mate.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)