Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Why objects get a name?

$
0
0
Whenever i create an object and restart, The objects get a weird numbers, Like a 3dtext
Check the picture out : http://prntscr.com/fadn3p
Any idea how to create them without see-ing them?

Code:

CMD:createobj(playerid, params[])
{
        new string[128], object;
          if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
        if(PlayerInfo[playerid][pMapper] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
        if(!mDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on Mapper Duty.");
        if(sscanf(params, "i", object)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /createobj [objectid]");

        for(new idx=1; idx<MAX_OBJ; idx++)
        {
            if(!ObjInfo[idx][oModel])
            {
                GetPlayerPos(playerid, ObjInfo[idx][oX], ObjInfo[idx][oY], ObjInfo[idx][oZ]);
                          ObjInfo[idx][oModel] = object;
                          oldoID = ObjInfo[idx][oModel];
                          oldodX = ObjInfo[idx][oX];
                          oldodY = ObjInfo[idx][oY];
                          oldodZ = ObjInfo[idx][oZ];
                          oldodRX = ObjInfo[idx][oRX];
                          oldodRY = ObjInfo[idx][oRY];
                          oldodRZ = ObjInfo[idx][oRZ];
                        ObjInfo[idx][oX] = ObjInfo[idx][oX] + 2;
                        ObjInfo[idx][oY] = ObjInfo[idx][oY] + 2;
                        ObjInfo[idx][oRX] = 0;
                        ObjInfo[idx][oRY] = 0;
                        ObjInfo[idx][oRZ] = 0;
                        // Creating
            ObjInfo[idx][obj] = CreateDynamicObject(ObjInfo[idx][oModel], ObjInfo[idx][oX], ObjInfo[idx][oY], ObjInfo[idx][oZ], ObjInfo[idx][oRX], ObjInfo[idx][oRY], ObjInfo[idx][oRZ]);
                        // Text
                        format(string, sizeof(string), "MapperWarn: %s has created object ID %d. (Object: %d)", RPN(playerid), idx, object);
                    SendMapperMessage(COLOR_GREEN, 1, string);
                        Log("logs/cbject.log", string);
                        idx = MAX_OBJ;
                }
        }
        return 1;
}


Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>