SA-MP Forums Archive
Moveable Objects for 0.3c version - 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: Moveable Objects for 0.3c version (/showthread.php?tid=234834)



Moveable Objects for 0.3c version - Amel_PAtomAXx - 04.03.2011

Please can somebody help me ,, i want make moveable object in SAMP like Gate but i dont know how to do that on 0.3c ,, somebody can help Please...


Re: Moveable Objects for 0.3c version - Stigg - 04.03.2011

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


Re: Moveable Objects for 0.3c version - Amel_PAtomAXx - 04.03.2011

yy but it didn't work aggain
look this :

C:\Documents and Settings\xy\Desktop\SAMP\samp03csvr_win32\gamemode s\rp3.pwn(39) : warning 225: unreachable code
C:\Documents and Settings\xy\Desktop\SAMP\samp03csvr_win32\gamemode s\rp3.pwn(39) : warning 217: loose indentation
C:\Documents and Settings\xy\Desktop\SAMP\samp03csvr_win32\gamemode s\rp3.pwn(39) : error 017: undefined symbol "obj"
C:\Documents and Settings\xy\Desktop\SAMP\samp03csvr_win32\gamemode s\rp3.pwn(40) : warning 217: loose indentation
C:\Documents and Settings\xy\Desktop\SAMP\samp03csvr_win32\gamemode s\rp3.pwn(99) : warning 225: unreachable code
C:\Documents and Settings\xy\Desktop\SAMP\samp03csvr_win32\gamemode s\rp3.pwn(99) : warning 217: loose indentation
C:\Documents and Settings\xy\Desktop\SAMP\samp03csvr_win32\gamemode s\rp3.pwn(101) : error 003: declaration of a local variable must appear in a compound block
C:\Documents and Settings\xy\Desktop\SAMP\samp03csvr_win32\gamemode s\rp3.pwn(101) : warning 217: loose indentation
C:\Documents and Settings\xy\Desktop\SAMP\samp03csvr_win32\gamemode s\rp3.pwn(101) : error 017: undefined symbol "string"
C:\Documents and Settings\xy\Desktop\SAMP\samp03csvr_win32\gamemode s\rp3.pwn(101) : warning 215: expression has no effect
C:\Documents and Settings\xy\Desktop\SAMP\samp03csvr_win32\gamemode s\rp3.pwn(101) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\xy\Desktop\SAMP\samp03csvr_win32\gamemode s\rp3.pwn(101) : fatal error 107: too many error messages on one line

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


5 Errors.


somebody can help??


Re: Moveable Objects for 0.3c version - Stigg - 04.03.2011

Can we see the code ?


Re: Moveable Objects for 0.3c version - Amel_PAtomAXx - 04.03.2011

IF YOU THINK ON THIS :


new obj;

obj = CreateObject(971,2105.41000000,-1230.98000000,26.21000000,0.00000000,0.00000000,18 0.00000000);
return 1;


if(strcmp(cmdtext, "/moveobject", true) == 0)

new string[50];
new movetime = MoveObject(obj, 971,2105.41000000,-1230.98000000,16.29000000);
format(string, sizeof(string), "Object will finish moving in %d milliseconds", movetime);

return 1;
}


Re: Moveable Objects for 0.3c version - Riddick94 - 04.03.2011

SendClientMessage in Command.


Re: Moveable Objects for 0.3c version - Amel_PAtomAXx - 04.03.2011

Thanks man ,, but i have some problems aggain look this :

C:\Documents and Settings\xy\Desktop\SAMP\samp03csvr_win32\gamemode s\rp3.pwn(43) : warning 225: unreachable code
C:\Documents and Settings\xy\Desktop\SAMP\samp03csvr_win32\gamemode s\rp3.pwn(43) : warning 217: loose indentation
C:\Documents and Settings\xy\Desktop\SAMP\samp03csvr_win32\gamemode s\rp3.pwn(44) : warning 217: loose indentation
C:\Documents and Settings\xy\Desktop\SAMP\samp03csvr_win32\gamemode s\rp3.pwn(106) : warning 225: unreachable code
C:\Documents and Settings\xy\Desktop\SAMP\samp03csvr_win32\gamemode s\rp3.pwn(116) : warning 225: unreachable code
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Warnings.

can you explane me something of this please


Re: Moveable Objects for 0.3c version - antonio112 - 05.03.2011

Lose indentation means that you thrown your code randomly, which you shouldn`t do !

Let me give you an example, which has been done numerous times:

Wrong example ( like yours )

pawn Код:
if(strcmp(cmdtext, "/moveobject", true) == 0)
           {
               new string[50];
new movetime = MoveObject(obj, 971,2105.41000000,-1230.98000000,16.29000000);
       format(string, sizeof(string), "Object will finish moving in %d milliseconds", movetime);

return 1;
}
Correct example:
pawn Код:
if(strcmp(cmdtext, "/moveobject", true) == 0)
        {
              new string[50];
              new movetime = MoveObject(obj, 971,2105.41000000,-1230.98000000,16.29000000);
              format(string, sizeof(string), "Object will finish moving in %d milliseconds", movetime);
              return 1;
        }
Overall, you have to organize your script a bit, not only that it looks better, it`s easier to read but you won`t get any warnings regarding the 'indentation'.

About the other errors ... can you show us those lines?


Re: Moveable Objects for 0.3c version - Amel_PAtomAXx - 05.03.2011

Yo man thats good thank you ,, now i have only 2 warnings
i dont know how to fix it can you tell me :

C:\Documents and Settings\xy\Desktop\SAMP\samp03csvr_win32\gamemode s\rp3.pwn(40) : warning 225: unreachable code
C:\Documents and Settings\xy\Desktop\SAMP\samp03csvr_win32\gamemode s\rp3.pwn(103) : warning 225: unreachable code
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Warnings.

I DONT KNOW WHAT THATS MEAN "unreachable code" CAN YOU TELL ME HOW TO FIX IT PLEASE



Re: Moveable Objects for 0.3c version - Mean - 05.03.2011

It means that you have put "return 1" and after that you put some code, and return is blocking the code, delete it.

Example:
pawn Код:
if( strcmp( cmdtext, "/cmd", true, 4 ) )
{
    return 1;
    SendClientMessage( playerid, 0xAAAAAA, "This is unreachable code" );
}