SA-MP Forums Archive
telepoort - 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: telepoort (/showthread.php?tid=102632)



telepoort - PANNA - 16.10.2009

i still get stuck when i want to make a teleport,
i do everything but i still get always 1 or 3 errors

here you go
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp("/da", cmdtext, true, 3) == 0)
  {
    SendClientMessage(playerid, 0xFF6600AA, "Desert Airstip");
    SetPlayerPos(playerid, 430.7528, 2504.6919, 16.4844);
    SetPlayerInterior(playerid, 0);
    return 1;
  }
  if(strcmp("/teles", cmdtext, true, 6) == 0)
  {
    SendClientMessage(playerid, 0xFF6600AA, "/da - /lvair");
    return 1;
  }
  return 0;
}
111	if(strcmp("/lvair", cmdtext, true, 6) == 0)
  {
    SendClientMessage(playerid, 0xFF6600AA, "Las Venturas Airport");
    SetPlayerPos(playerid, 1319.0171, 1251.5916, 10.8203);
    SetPlayerInterior(playerid, 0);
116    return 1;
  }
and now i still got 2 errors,



C:\Users\Onno\Documents\da\gamemodes\saa.pwn(111) : error 010: invalid function or declaration
C:\Users\Onno\Documents\da\gamemodes\saa.pwn(116) : error 010: invalid function or declaration


btw, sorry i ask alot but im new to this.


Re: telepoort - TheNooB - 16.10.2009

What is the line 111 and 116?


Re: telepoort - CarlosGF - 16.10.2009

Bug? :P


Re: telepoort - [SFD]Marco - 16.10.2009

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp("/da", cmdtext, true) == 0)
  {
    SendClientMessage(playerid, 0xFF6600AA, "Desert Airstip");
    SetPlayerPos(playerid, 430.7528, 2504.6919, 16.4844);
    SetPlayerInterior(playerid, 0);
        return 1;
    }
  if(strcmp("/teles", cmdtext, true) == 0)
  {
    SendClientMessage(playerid, 0xFF6600AA, "/da - /lvair");
        return 1;
    }
    if(strcmp("/lvair", cmdtext, true) == 0)
  {
    SendClientMessage(playerid, 0xFF6600AA, "Las Venturas Airport");
    SetPlayerPos(playerid, 1319.0171, 1251.5916, 10.8203);
    SetPlayerInterior(playerid, 0);
        return 1;
    }
  return 0;
  }



Re: telepoort - PANNA - 16.10.2009

Quote:
Originally Posted by TheNooB
What is the line 111 and 116?
sorry :P

updated
most of the time i find the errors myself but now i really get stuck on it ;p


Re: telepoort - TheNooB - 16.10.2009

Quote:
Originally Posted by PANNA
i still get stuck when i want to make a teleport,
i do everything but i still get always 1 or 3 errors

here you go
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp("/da", cmdtext, true, 3) == 0)
  {
    SendClientMessage(playerid, 0xFF6600AA, "Desert Airstip");
    SetPlayerPos(playerid, 430.7528, 2504.6919, 16.4844);
    SetPlayerInterior(playerid, 0);
    return 1;
  }
  if(strcmp("/teles", cmdtext, true, 6) == 0)
  {
    SendClientMessage(playerid, 0xFF6600AA, "/da - /lvair");
    return 1;
  }
  return 0;
}
	if(strcmp("/lvair", cmdtext, true, 6) == 0)
  {
    SendClientMessage(playerid, 0xFF6600AA, "Las Venturas Airport");
    SetPlayerPos(playerid, 1319.0171, 1251.5916, 10.8203);
    SetPlayerInterior(playerid, 0);
    return 1;
  }
and now i still got 2 errors,



C:\Users\Onno\Documents\da\gamemodes\saa.pwn(111) : error 010: invalid function or declaration
C:\Users\Onno\Documents\da\gamemodes\saa.pwn(116) : error 010: invalid function or declaration


btw, sorry i ask alot but im new to this.
return 0 in the middle of the code?

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/da", cmdtext, true, 3) == 0)
    {
    SendClientMessage(playerid, 0xFF6600AA, "Desert Airstip");
    SetPlayerPos(playerid, 430.7528, 2504.6919, 16.4844);
    SetPlayerInterior(playerid, 0);
    return 1;
    }
    if(strcmp("/teles", cmdtext, true, 6) == 0)
    {
    SendClientMessage(playerid, 0xFF6600AA, "/da - /lvair");
    return 1;
    }
    if(strcmp("/lvair", cmdtext, true, 6) == 0)
    {
    SendClientMessage(playerid, 0xFF6600AA, "Las Venturas Airport");
    SetPlayerPos(playerid, 1319.0171, 1251.5916, 10.8203);
    SetPlayerInterior(playerid, 0);
    return 1;
    }
    return 0;
    }
Edit: To Marco

Quote:
Originally Posted by [SFD
Marco ]
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp("/da", cmdtext, true) == 0)
  {
    SendClientMessage(playerid, 0xFF6600AA, "Desert Airstip");
    SetPlayerPos(playerid, 430.7528, 2504.6919, 16.4844);
    SetPlayerInterior(playerid, 0);
        return 1;
    }
  if(strcmp("/teles", cmdtext, true) == 0)
  {
    SendClientMessage(playerid, 0xFF6600AA, "/da - /lvair");
        return 1;
    }
    if(strcmp("/lvair", cmdtext, true) == 0)
  {
    SendClientMessage(playerid, 0xFF6600AA, "Las Venturas Airport");
    SetPlayerPos(playerid, 1319.0171, 1251.5916, 10.8203);
    SetPlayerInterior(playerid, 0);
        return 1;
    }
  return 0;
  }
return 1 with two space tab cause loose indentation


Re: telepoort - MenaceX^ - 16.10.2009

You've put the command out of the OnPlayerCommandText's callback..


Re: telepoort - Hiitch - 16.10.2009

Quote:
Originally Posted by PANNA
Quote:
Originally Posted by TheNooB
What is the line 111 and 116?
sorry :P

updated
most of the time i find the errors myself but now i really get stuck on it ;p
Panna, read what [SFD]Marco posted, this code looks very accurate, and should work.


Re: telepoort - PANNA - 16.10.2009

thanks man it works now