Moveable Objects for 0.3c version
#1

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

https://sampwiki.blast.hk/wiki/MoveObject
Reply
#3

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

Can we see the code ?
Reply
#5

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

SendClientMessage in Command.
Reply
#7

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

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

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

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" );
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)