SA-MP Forums Archive
[BUG] Sa-Mp wiki scripting mistake :D - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP (https://sampforum.blast.hk/forumdisplay.php?fid=3)
+--- Forum: Bug Reports (https://sampforum.blast.hk/forumdisplay.php?fid=20)
+--- Thread: [BUG] Sa-Mp wiki scripting mistake :D (/showthread.php?tid=487452)



[BUG] Sa-Mp wiki scripting mistake :D - bugi - 13.01.2014

I think this is wrong:

Код:
new object;
public OnGameModeInit()
{
    object = CreateObject(1337, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
}
 
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/oedit", true))
    {
        EditObject(playerid, objectid);
        SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: You can now edit the object!");
        return 1;
    }
    return 0;
}
It should be like this?

Код:
new object;
public OnGameModeInit()
{
    object = CreateObject(1337, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
}
 
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/oedit", true))
    {
        EditObject(playerid, object);
        SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: You can now edit the object!");
        return 1;
    }
    return 0;
}



Re: [BUG] Sa-Mp wiki scripting mistake :D - Hansrutger - 13.01.2014

What's the difference? xD Sorry haha.

EDIT: Now I saw it, yes I think that is supposed to be like the way you write it.


Re: [BUG] Sa-Mp wiki scripting mistake :D - bugi - 13.01.2014

Yeah sure it is If u compile the script on wiki-samp you'll get the error: undefined symbol "objectid"


Re: [BUG] Sa-Mp wiki scripting mistake :D - PT - 13.01.2014

next time put the link were is located the bug, it's better to help beta tester or someone can edit wiki, to correct that small "bug".


Re: [BUG] Sa-Mp wiki scripting mistake :D - Vince - 13.01.2014

Fixed.


Re: [BUG] Sa-Mp wiki scripting mistake :D - Drebin - 14.01.2014

Quote:
Originally Posted by Gamer_Z
Посмотреть сообщение
yup and it's not mandatory but if you want to be formal, a return 1; needs to be at the end of the OnGameModeInit
Done.