07.05.2017, 08:56
Hello, Does anyone know how to add randomly fire to houses? And when fire is up to send message to firemans?
I find a code , but i didn't know if it's right!
Who can help me?
I find a code , but i didn't know if it's right!
Код:
forward AddFiresHouse(houseid); public AddFiresHouse(houseid) { for(new i = 1;i< 1000; i++) { if(FireObjHouse[i] == 0) { new ID = i; new Float:x1, Float:y1, Float:z1; x1 = HouseData[houseid][hEntrancex]; y1 = HouseData[houseid][hEntrancey]; z1 = HouseData[houseid][hEntrancez]; FireObjHouse[ID] = CreateObject(18688, x1, y1, z1, 0, 0, 0.0); i = 10001; FireHouse[1][houseid] = FireObjHouse[ID]; TotalFires++; FiresHouse[houseid]++; FireHealthHouse[1][houseid] = 15; for(new j = 1;j< 1000; j++) { if(FireObjHouse[j] == 0) { ID = j; new Float:x2, Float:y2, Float:z2; x2 = HouseData[houseid][hEntrancex]; y2 = HouseData[houseid][hEntrancey]; z2 = HouseData[houseid][hEntrancez]; FireObjHouse[ID] = CreateObject(18688, x2, y2, z2, 0, 0, 0.0); j = 10001; FireHouse[2][houseid] = FireObjHouse[ID]; TotalFires++; FiresHouse[houseid]++; FireHealthHouse[2][houseid] = 28; for(new k = 1;k< 1000; k++) { if(FireObjHouse[k] == 0) { ID = k; new Float:x3, Float:y3, Float:z3; x3 = HouseData[houseid][hEntrancex]; y3 = HouseData[houseid][hEntrancey]; z3 = HouseData[houseid][hEntrancez]; FireObjHouse[ID] = CreateObject(18688, x3, y3, z3, 0, 0, 0.0); k = 10001; FireHouse[3][houseid] = FireObjHouse[ID]; TotalFires++; FiresHouse[houseid]++; FireHealthHouse[3][houseid] = 46; for(new l = 1;l< 1000; l++) { if(FireObjHouse[l] == 0) { ID = l; new Float:x4, Float:y4, Float:z4; x4 = HouseData[houseid][hEntrancex]; y4 = HouseData[houseid][hEntrancey]; z4 = HouseData[houseid][hEntrancez]; FireObjHouse[ID] = CreateObject(18688, x4, y4, z4, 0, 0, 0.0); l = 10001; FireHouse[4][houseid] = FireObjHouse[ID]; TotalFires++; FiresHouse[houseid]++; FireHealthHouse[4][houseid] = 65; for(new h = 1;h< 1000; h++) { if(FireObjHouse[h] == 0) { ID = h; new Float:x5, Float:y5, Float:z5; x5 = HouseData[houseid][hEntrancex]; y5 = HouseData[houseid][hEntrancey]; z5 = HouseData[houseid][hEntrancez]; FireObjHouse[ID] = CreateObject(18688, x5, y5, z5, 0, 0, 0.0); h = 10001; FireHouse[5][houseid] = FireObjHouse[ID]; TotalFires++; FiresHouse[houseid]++; FireHealthHouse[5][houseid] = 88; } } } } } } } } } } return 1; }