SA-MP Forums Archive
teleport command; 2 errors - 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: teleport command; 2 errors (/showthread.php?tid=246009)



teleport command; 2 errors - davelord - 02.04.2011

error

Quote:

C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 431) : error 010: invalid function or declaration
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 434) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.

cmd
Quote:

}
if(!strcmp(cmdtext, "/go", true, 3)
{
SetPlayerPos 637.5580 -5340.8470 3.2990 360.0000 0
return 1;
}




Re: teleport command; 2 errors - C-a-g-e - 02.04.2011

Код:
if(!strcmp(cmdtext, "/go", true, 3)
{
SetPlayerPos(playerid,637.5580, -5340.8470, 3.2990);
return 1;
}
It should work now.


Re: teleport command; 2 errors - antonio112 - 02.04.2011

pawn Код:
if (strcmp("/go", cmdtext, true, 3) == 0)
{
     SetPlayerPos 637.5580 -5340.8470 3.2990 360.0000 0
     return 1;
}



Re: teleport command; 2 errors - davelord - 02.04.2011

....
Quote:

C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 429) : warning 217: loose indentation
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 431) : error 076: syntax error in the expression, or invalid function call
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 431) : warning 215: expression has no effect
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 431) : error 001: expected token: ";", but found "-rational value-"
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 431) : warning 215: expression has no effect
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 431) : error 001: expected token: ";", but found "-rational value-"
C:\Users\Mijn pc\Desktop\davy's mapke\SERVER\roleplay\Andre's\gamemodes\test1.pwn( 431) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.




Re: teleport command; 2 errors - -Rebel Son- - 02.04.2011

When you make your command like that first one, It's like this.

if(!strcmp(cmdtext,"/comand",true)) {
return true;}

No need for a Command size in there.


Re: teleport command; 2 errors - CrazyBlob - 02.04.2011

Код:
if (strcmp("/go", cmdtext, true, 3) == 0)
{
     SetPlayerPos 637.5580 -5340.8470 3.2990 360.0000 0);
     return 1;
}
their and if you want it to send them a message when they teleport

Код:
if (strcmp("/go", cmdtext, true, 3) == 0)
{
     SetPlayerPos 637.5580 -5340.8470 3.2990 360.0000 0);
     SendClientMessage(playerid,0xFFFFFFFF,"You Teleported To /go!");
     return 1;
}



Re: teleport command; 2 errors - davelord - 02.04.2011

I dont get it.


Re: teleport command; 2 errors - C-a-g-e - 02.04.2011

Quote:
Originally Posted by davelord
Посмотреть сообщение
....
Well, you have messed up the coordines I guess , So you should go in game and save the position that you want.

Then read this it would help you more

https://sampwiki.blast.hk/wiki/SetPlayerPos


Re: teleport command; 2 errors - davelord - 02.04.2011

Still got the same errors.


Re: teleport command; 2 errors - C-a-g-e - 02.04.2011

Can you show us line 431 ?


Re: teleport command; 2 errors - ilikenuts - 02.04.2011

try:
pawn Код:
if (strcmp("/go", cmdtext, true) == 0)
{
      SetPlayerPos(637.5580 -5340.8470 3.2990 360.00);
      return 1;
}
my pawno say no errors.

hope i helped!