SA-MP Forums Archive
Adding a map into a gm? - 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: Adding a map into a gm? (/showthread.php?tid=260316)



Adding a map into a gm? - Tyler_Cordwell - 08.06.2011

Okay, I tryed adding my mapping to the bottom of the GameMode it was converted, but this is the error im getting can anyone help me?
C:\Users\VPS1220Admin\Desktop\PCRP\gamemodes\VRP.p wn(45271) : error 021: symbol already defined:"CreateObject"


Re: Adding a map into a gm? - PGTips - 08.06.2011

put all object under

Public OnGamemodeInit

objects wll only work under that header


Re: Adding a map into a gm? - Tyler_Cordwell - 08.06.2011

Sorry for so many questions, im new to this, ok so i found "public OnGameModeInit()", In-between the "()" do i put the object codes in there? or under "public OnGameModeInit()"


Re: Adding a map into a gm? - PGTips - 08.06.2011

you put the objects like this

public OnGamemodeInit();
{
//objects under here
}

do not remove the return 1 and return 1 should be bleow everything else


Re: Adding a map into a gm? - Firzendxiw - 08.06.2011

Example
pawn Код:
public OnGameModeInit()
{
    CreateObject();
    CreateObject();
    CreateObject();
    CreateObject();
    CreateObject();
    CreateObject();
    (Code stuff)
    return 1;
}
Hope this helps


Re: Adding a map into a gm? - Tyler_Cordwell - 08.06.2011

Thanks, but its just Making the compiler to stop responding when i try compiling


Re: Adding a map into a gm? - PGTips - 08.06.2011

you are missing a bracket or you have to meny brackets or you have put the objects in a miaddle of a code please pistyour OnGamemodeInit();

here


Re: Adding a map into a gm? - Firzendxiw - 08.06.2011

Which one of the comments did you use, mine or PGTips?
btw CreateObject(details and stuff like normal);
Example
CreateObject(4564,-2755.38623000,-1972.75805700,44.68423500,0.00000000,0.00000000,32 0.56948531);

btw PGTips review your code
pawn Код:
public OnGamemodeInit();
{
//objects under here
}



Re: Adding a map into a gm? - Tyler_Cordwell - 08.06.2011

Код:
public OnGamemodeInit();
{
CreateObject(990,2458.39257812,-1669.05749512,14.02740955,0.00000000,0.00000000,0.00000000); //object(bar_barrier12) (1)
CreateObject(990,2448.42993164,-1669.09985352,14.02753353,0.00000000,0.00000000,0.00000000); //object(bar_barrier12) (2)
CreateObject(990,2438.37524414,-1669.14343262,14.05532551,0.00000000,0.00000000,0.00000000); //object(bar_barrier12) (3)
}



Re: Adding a map into a gm? - Firzendxiw - 08.06.2011

Quote:
Originally Posted by Tyler_Cordwell
Посмотреть сообщение
Код:
public OnGamemodeInit();
{
CreateObject(990,2458.39257812,-1669.05749512,14.02740955,0.00000000,0.00000000,0.00000000); //object(bar_barrier12) (1)
CreateObject(990,2448.42993164,-1669.09985352,14.02753353,0.00000000,0.00000000,0.00000000); //object(bar_barrier12) (2)
CreateObject(990,2438.37524414,-1669.14343262,14.05532551,0.00000000,0.00000000,0.00000000); //object(bar_barrier12) (3)
}
Main problems in here it should be
public OnGamemodeInit() not public OnGamemodeInit();
and the return 1;
pawn Код:
public OnGamemodeInit()
{
    CreateObject(990,2458.39257812,-1669.05749512,14.02740955,0.00000000,0.00000000,0.00000000); //object(bar_barrier12) (1)
    CreateObject(990,2448.42993164,-1669.09985352,14.02753353,0.00000000,0.00000000,0.00000000); //object(bar_barrier12) (2)
    CreateObject(990,2438.37524414,-1669.14343262,14.05532551,0.00000000,0.00000000,0.00000000); //object(bar_barrier12) (3)
    return 1;
}