07.09.2016, 13:07
Hi
I don't got errors/warrnings, but once i try it in game, it works, but the "unknown command" msg show up too, only in this command, if i type another command, it works perfectly..
Код:
CMD:createobject(playerid, params[]) { if(!(PlayerInfo[playerid][pAdmin] >= 4)) return SCM(playerid, COLOR_GREY, "You can't use this command."); new oid,omodel,string[128],Float:Pos[3]; GetPlayerPos(playerid, Pos[0],Pos[1],Pos[2]); if(sscanf(params, "dd",oid,omodel)) return SCM(playerid, COLOR_WHITE, "USAGE: /createobject [id] [modelid]"); if(oid >= MAX_GATES) return SCM(playerid, COLOR_WHITE, "Invalid ID."); if(oinfo[oid][oactive] == 0) { oinfo[oid][ox] = Pos[0]; oinfo[oid][oy] = Pos[1]; oinfo[oid][oz] = Pos[2]; oinfo[oid][oactive] = 1; oinfo[oid][objectid] = omodel; oinfo[oid][modelid] = CreateDynamicObject(oinfo[oid][objectid],oinfo[oid][ox],oinfo[oid][oy],oinfo[oid][oz],180,180,90,-1,-1,-1,200.0); format(string,sizeof(string), "You have created an object with ID %d and model %d",oid,omodel); SCM(playerid, COLOR_YELLOW, string); SaveAllObjects(); } else { SCM(playerid, COLOR_WHITE, "This object is already used."); } return 1; }