28.11.2014, 15:53
I made xmas tree system and when I type /izbrisielka(deletexmas) [ID] file is delete but when I click 'Y' gives me some money and create again xmas tree O.o
Код:
CMD:izbrisielka(playerid, params[])//deletexmastree { if(PlayerInfo[playerid][pAdmin] >= 2014) { new id, elka[999]; if(sscanf(params, "i",id)) return SendClientMessage(playerid,-1, "{00EAEA}KORISTI:{FF5300}/izbrisielka [ID]"); format(elka, sizeof(elka), ELKA_FILE, id); if(fexist(elka)) { DestroyDynamicObject(Elka[id]); DestroyDynamicObject(Po1[id]); DestroyDynamicObject(Po2[id]); DestroyDynamicObject(Po3[id]); DestroyDynamicObject(Po4[id]); DestroyDynamicObject(Po5[id]); DestroyDynamicObject(Po6[id]); DestroyDynamicObject(Po7[id]); DestroyDynamicObject(Po8[id]); Delete3DTextLabel(E3D[id]); fremove(elka); } else { SendClientMessage(playerid,-1,"{00FFFF}(DWIG){FF5300} Ne postoi elka so toj ID!"); } } return 1; }
Код:
CMD:napravielka(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 2014) { new id,Float:eX,Float:eY,Float:eZ; new vopoklon = 9999 + random(30000); GetPlayerPos(playerid, eX, eY, eZ); if(sscanf(params, "i",id)) return SendClientMessage(playerid,-1, "{00EAEA}KORISTI:{FF5300}/napravielka [ID]"); ElkaInfo[id][eID] = id; ElkaInfo[id][EX] = eX; ElkaInfo[id][EY] = eY; ElkaInfo[id][EZ] = eZ-1.0; ElkaInfo[id][P1] = eZ-0.4; ElkaInfo[id][P2] = eZ-0.4; ElkaInfo[id][P3] = eZ-0.4; ElkaInfo[id][P4] = eZ-0.4; ElkaInfo[id][P5] = eZ-1.0; ElkaInfo[id][P6] = eZ-1.0; ElkaInfo[id][P7] = eZ-1.0; ElkaInfo[id][P8] = eZ-1.0; ElkaInfo[id][ePoklon] = vopoklon; ElkaInfo[id][eZemenPoklon] = 1; E3D[id]= CreateDynamic3DTextLabel("Stisnete 'Y' za da go zemete poklonot", 0xFF8040FF, ElkaInfo[id][EX],ElkaInfo[id][EY],ElkaInfo[id][EZ], 25.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 8.0); Elka[id] = CreateDynamicObject(19076, eX, eY, eZ-1.0, 0.0000, 0.0000, 0.0000); Po1[id] = CreateDynamicObject(19054, eX, eY+1.0, eZ-0.4,0,0,300); Po2[id] = CreateDynamicObject(19058, eX+1.0, eY, eZ-0.4,0,0,300); Po3[id] = CreateDynamicObject(19056, eX, eY-1.0, eZ-0.4,0,0,300); Po4[id] = CreateDynamicObject(19057, eX-1.0, eY, eZ-0.4,0,0,300); Po5[id] = CreateDynamicObject(19058, eX-1.5, eY+1.5, eZ-1.0,0,0,300); Po6[id] = CreateDynamicObject(19055, eX+1.5, eY-1.5, eZ-1.0,0,0,300); Po7[id] = CreateDynamicObject(19057, eX+1.5, eY+1.5, eZ-1.0,0,0,300); Po8[id] = CreateDynamicObject(19054, eX-1.5, eY-1.5, eZ-1.0,0,0,300); SetPlayerPos(playerid, eX+1.5, eY+1.5, eZ+0.5); ZacuvajElka(id); } return 1; }
Код:
if(newkeys == KEY_YES) { for(new i; i < MAX_ELKI; i++) { if(IsPlayerInRangeOfPoint(playerid, 6.0, ElkaInfo[i][EX], ElkaInfo[i][EY], ElkaInfo[i][EZ])) { if(ElkaInfo[i][eZemenPoklon] == 1) { GivePlayerMoney(playerid,ElkaInfo[i][ePoklon]); ElkaInfo[i][eZemenPoklon] = 0; ZacuvajElka(i); SCMF(playerid,CRVENA, "{00FFFF}(DWIG){FF5300}Dobivte %d$ od poklonot,so srekja!",ElkaInfo[i][ePoklon]); } else return SendClientMessage(playerid,CRVENA, "{00FFFF}(DWIG){FF5300}Vekje poklonot e otvoren"); } } }