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



Object Command - SlashPT - 21.12.2009

hey all im having a problem im doing a /object command so it when i create the object haves to attach the object to me but it dont attach with my code so im going to post here if any guy know plz correct it
pawn Код:
dcmd_object(playerid, params[])
{
    new string2[256];
    new tmp[256];
    new Index;
    tmp = strtok(params,Index);
    new id;
    id = strval(tmp);
    if(PlayerInfo[playerid][pAdmin] <= 1) return SendClientMessage(playerid,0xFFFFFFFF,"(Admin System): Sir we donґt know you, you arenґt autorized to use that CMD");
    if(!strlen(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /object [Model]");
    {
        format(string2, sizeof(string2), "** You created the object %d near you! **",id);
        SendClientMessage(playerid,COLOR_ORANGE, string2);
        new Float:CarX,Float:CarY,Float:CarZ;
        new Float:X,Float:Y,Float:Z;
        GetPlayerPos(playerid,CarX,CarY,CarZ);
        new HAH;
        HAH = CreateDynamicObject(id,CarX+3,CarY,CarZ,0,0,0);
        SetDynamicObjectPos(HAH,CarX+3,CarY,CarZ);
        AttachDynamicObjectToPlayer(HAH,playerid,X,Y,Z,0,0,0);
    }
    return 1;
}
im using Y_Objects but if you can do it in normal (Pawno) its okay
thanks for see DarK TeaM