SA-MP Forums Archive
Object Help - 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: Object Help (/showthread.php?tid=657075)



Object Help - tobi736 - 31.07.2018

i watch wiki sa-mp
i code my own code
this is my code
new object;
public onplayergamemodeinit()
{
object = CreateObject(19360, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
}
cmd:test(playerid, params[])
{
EditObject(playerid, objecthouse);
SendClientMessageEx(playerid, COLOR_GRAY, "TESTING");
return 1;
}
i complie success, but i join game i use and no happened
please help me
my english bad, sorry


Re: Object Help - JasonRiggs - 31.07.2018

You made some mistakes..

PHP код:
public OnGameModeInIt()
{
object CreateObject(193600.00.00.00.00.00.0);
}
cmd:test(playeridparams[])
{
EditObject(playeridobject);
SendClientMessageEx(playeridCOLOR_GRAY"TESTING");
return 
1;

You made the player edit the object called "objecthouse" not "object".. So you should do it like that ^^,
Also you made another mistake.. You created the object under something called "onplayergamemodeinit", That's wrong, You must use OnGameModeInIt.. so the object will spawn... You'll find OnGameModeInIt already there in your script.. just put the line
PHP код:
object CreateObject(193600.00.00.00.00.00.0); 
anywhere under it.. and don't forget to put the
PHP код:
new object
on top of the script under the includes..


Re: Object Help - tobi736 - 31.07.2018

i put the Createobject to ongamemodeinit
but won't work


Re: Object Help - tobi736 - 31.07.2018

i put to the ongamemodeinit
won't work


Re: Object Help - RJTabish - 31.07.2018

Put This OnGamemodeinit
PHP код:
public OnGameModeInIt()
{
object CreateObject(193600.00.00.00.00.00.0);

and then this is kind of define put on the top

PHP код:
new object
Now Paste this as a separate place not in the ongamemodeinit lol empty place

PHP код:
cmd:test(playeridparams[])
{
EditObject(playeridobject);
SendClientMessageEx(playeridCOLOR_GRAY"TESTING");
return 
1;



Look Like This
PHP код:
new object
PHP код:
public OnGameModeInIt() 

object CreateObject(193600.00.00.00.00.00.0); 

PHP код:
cmd:test(playeridparams[]) 

EditObject(playeridobject); 
SendClientMessageEx(playeridCOLOR_GRAY"TESTING"); 
return 
1




Re: Object Help - tobi736 - 31.07.2018

bro, won't work
i put to OnGameModeInit. createobject and i do what your said
but i use /test don't show object


Re: Object Help - tobi736 - 05.08.2018

Yes,i do all but won't work


Re: Object Help - GRiMMREAPER - 05.08.2018

Can you show us your current code?


Re: Object Help - tobi736 - 05.08.2018

Quote:

new object
public OnGameModeInIt()
{
object = CreateObject(19360, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
}
cmd:test(playerid, params[])
{
EditObject(playerid, object);
SendClientMessageEx(playerid, COLOR_GRAY, "TESTING");
return 1;
}

This is my code, i compile success but i use cmd /test, nothing show up, just show the cursor


Re: Object Help - GRiMMREAPER - 05.08.2018

You wrote "OnGamemodeInIt".

pawn Код:
new object;

public OnGameModeInit()
{
    object = CreateObject(19360, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
    return 1;
}

cmd:test(playerid, params[])
{
    EditObject(playerid, object);
    SendClientMessageEx(playerid, COLOR_GRAY, "TESTING");
    return 1;
}