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



Object - raamiix - 24.03.2013

This is toy editor and i want to add it into my gamemode. Where in my gamemode i going to add that and can someone add that to ZCMD?

Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerAttachedObject(playerid, 0, 1337, 2);
}
 
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/edit", true))
    {
        EditAttachedObject(playerid, 0);
        SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: You now edit your attached object on index slot 0!");
        return 1;
    }
    return 0;
}



Re: Object - LeeXian99 - 24.03.2013

I think just this needs to change. Remove the public OnPlayerCommandText...

pawn Код:
CMD:edit(playerid,params[])
{
    EditAttachedObject(playerid, 0);
    SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: You now edit your attached object on index slot 0!");
    return 1;
}



Re: Object - Mystique - 24.03.2013

And put it outside OnPlayerCommandText, it should be outside any callback.