SA-MP Forums Archive
Problem with CreateObject - 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)
+--- Thread: Problem with CreateObject (/showthread.php?tid=320165)



Problem with CreateObject - rangerxxll - 21.02.2012

I'm trying to add these objects into a game mode/filterscript and I get a error message.
Here's my code for my OnGameModeInIt
pawn Код:
public OnGameModeInit()
{
   
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    // objects
    CreateObject(987,1661.80004883,-1885.09997559,12.50000000,0.00000000,0.00000000,0. 00000000); //object(elecfence_bar) (1)
    CreateObject(987,1649.80004883,-1885.09997559,12.60000038,0.00000000,0.00000000,0. 00000000); //object(elecfence_bar) (2)
    CreateObject(987,1637.69995117,-1884.90002441,12.60000038,0.00000000,0.00000000,0. 00000000); //object(elecfence_bar) (3)
    CreateObject(985,1633.40002441,-1884.50000000,12.60000038,0.00000000,0.00000000,0. 00000000); //object(gate_autor) (1)
    CreateObject(987,1617.80004883,-1884.69995117,12.50000000,0.00000000,0.00000000,0. 00000000); //object(elecfence_bar) (4)
    CreateObject(987,1610.50000000,-1884.69995117,12.80000019,0.00000000,0.00000000,0. 00000000); //object(elecfence_bar) (5)
    return 1;
}
And the error message.
Код:
C:\Users\Luke\Desktop\test.pwn(39) : error 001: expected token: ",", but found "."
C:\Users\Luke\Desktop\test.pwn(39) : error 029: invalid expression, assumed zero
C:\Users\Luke\Desktop\test.pwn(39) : warning 215: expression has no effect
C:\Users\Luke\Desktop\test.pwn(39) : error 001: expected token: ";", but found ")"
C:\Users\Luke\Desktop\test.pwn(39) : fatal error 107: too many error messages on one line

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


4 Errors.
Line 39 is the "first" CreateObject. What's wrong with it?


Re : Problem with CreateObject - BigBaws - 21.02.2012

Espace on the last of your create objects 's (0. 00000000) do it (0.00000000) Try


Re: Re : Problem with CreateObject - rangerxxll - 21.02.2012

Quote:
Originally Posted by BigBaws
Посмотреть сообщение
Espace on the last of your create objects 's (0. 00000000) do it (0.00000000) Try
Didn't work.


Re: Problem with CreateObject - Nuke547 - 21.02.2012

Try this
PHP код:
public OnGameModeInit()
{
    
    
SetGameModeText("Blank Script");
    
AddPlayerClass(01958.37831343.157215.3746269.1425000000);
    
// objects
    
CreateObject(987,1661.80004883,-1885.09997559,12.50000000,0.00000000,0.00000000,0.00000000); //object(elecfence_bar) (1)
    
CreateObject(987,1649.80004883,-1885.09997559,12.60000038,0.00000000,0.00000000,0.00000000); //object(elecfence_bar) (2)
    
CreateObject(987,1637.69995117,-1884.90002441,12.60000038,0.00000000,0.00000000,0.00000000); //object(elecfence_bar) (3)
    
CreateObject(985,1633.40002441,-1884.50000000,12.60000038,0.00000000,0.00000000,0.00000000); //object(gate_autor) (1)
    
CreateObject(987,1617.80004883,-1884.69995117,12.50000000,0.00000000,0.00000000,0.00000000); //object(elecfence_bar) (4)
    
CreateObject(987,1610.50000000,-1884.69995117,12.80000019,0.00000000,0.00000000,0.00000000); //object(elecfence_bar) (5)
    
return 1;




Re: Problem with CreateObject - austin070 - 21.02.2012

EDIT: Beat me to it.