telepoort
#1

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

What is the line 111 and 116?
Reply
#3

Bug? :P
Reply
#4

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

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
Reply
#6

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

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

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

thanks man it works now
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)