06.08.2009, 09:43
Under OnGameModeInit:
addDmapIcon:
Code:
if(dini_Int(HouseFile(i), "Kaufbar") == 1) { //ChangeMapIconInfo(playerid,H_Icon[playerid][i], dini_Int(HouseFile(i), "x"),dini_Int(HouseFile(i),"y"),dini_Int(HouseFile(i), "z"), 31, 800); nIconDestroyForAll(H_Icon[i]); H_Icon[i] = nIconAddForAll(HausInfos[i][Hx],HausInfos[i][Hy],HausInfos[i][Hz],31); format(hinfo,255,"<font color=BLUE>%s</font> <font color=GREEN>steht zum Verkauf!</font><br><font color=BLUE>Preis:</font> <font color=RED>%d$</font> <font color=BLUE>Score:</font> <font color=RED>%d</font>",dini_Get(HouseFile(i), "Name"),dini_Int(HouseFile(i), "Preis"),dini_Int(HouseFile(i), "Score")); format(h2info,64,"%s ist frei",dini_Get(HouseFile(i), "Name")); addDmapIcon(HausInfos[i][Hx],HausInfos[i][Hy],31,h2info,hinfo); } else if(dini_Int(HouseFile(i), "Kaufbar") == 0) { //ChangeMapIconInfo(playerid,H_Icon[playerid][i], dini_Int(HouseFile(i), "x"),dini_Int(HouseFile(i),"y"),dini_Int(HouseFile(i), "z"), 32, 800); nIconDestroyForAll(H_Icon[i]); H_Icon[i] = nIconAddForAll(HausInfos[i][Hx],HausInfos[i][Hy],HausInfos[i][Hz],32); format(hinfo,255,"<font color=BLUE>%s</font> <font color=GREEN>gehört</font> <font color=RED>%s</font>",dini_Get(HouseFile(i), "Name"),dini_Get(HouseFile(i), "Besitzer")); format(h2info,64,"%s ist besetzt",dini_Get(HouseFile(i), "Name")); H_DIcon[i] = addDmapIcon(HausInfos[i][Hx],HausInfos[i][Hy],32,h2info,hinfo); }
Code:
new DMAP_last_icon = 0; stock addDmapIcon(Float:x,Float:y,icon_id,name[],text[]) { new tmp[DJSON_MAX_STRING]; DMAP_last_icon++; format(tmp,DJSON_MAX_STRING,"items/i%d/id",DMAP_last_icon); djSetInt("dmap_feed.json",tmp,DMAP_last_icon); format(tmp,DJSON_MAX_STRING,"items/i%d/name",DMAP_last_icon); djSet("dmap_feed.json",tmp,name); format(tmp,DJSON_MAX_STRING,"items/i%d/text",DMAP_last_icon); djSet("dmap_feed.json",tmp,text); format(tmp,DJSON_MAX_STRING,"items/i%d/icon",DMAP_last_icon); djSetInt("dmap_feed.json",tmp,icon_id); //SetFloat format(tmp,DJSON_MAX_STRING,"items/i%d/pos/x",DMAP_last_icon); djSetInt("dmap_feed.json",tmp,floatround(x)); format(tmp,DJSON_MAX_STRING,"items/i%d/pos/y",DMAP_last_icon); djSetInt("dmap_feed.json",tmp,floatround(y)); return DMAP_last_icon; }