A random hely meg nem megoldható, max. több, meghatározott helyen lehetséges.
if(GetPlayerWeapon(playerid) == WEAPON_FIREEXTINGUISHER && newkeys == KEY_FIRE)
#define FILTERSCRIPT#include <a_samp>#include <zcmd>#define MAX_FIRELOCATION 2forward RandomFire(playerid);forward FireEx(playerid);new Float:CurrentFireX, Float:CurrentFireY, Float:CurrentFireZ;new FireObj[5],FireTimer;new Float:FireLocation [MAX_FIRELOCATION][3] = // A \'MAX_FIRELOCATION\' -t állítsd annyira a #define -nél ahány tűz koordinátát megadsz!!{{0.0,0.0,2.0},//X,Y,Z{40.0,0.0,2.0}};new ExtingFire[MAX_PLAYERS];new FireExTimer[MAX_PLAYERS];new FireCP[MAX_PLAYERS];public OnFilterScriptInit(){print(\"=======[FilterScript Started]=======\");print(\"Random+Oltható Tűz FilterScript betöltve! by. .RäNĐoM.\");FireTimer = SetTimer(\"RandomFire\",5*60000,true);//Five minutesreturn 1;}public OnFilterScriptExit(){print(\"=======[FilterScript Exit]=======\");print(\"Random+Oltható Tűz FilterScript leállt! by. .RäNĐoM.\");KillTimer(FireTimer);return 1;}public OnPlayerConnect(playerid){ExtingFire[playerid] = 0;return 1;}public OnPlayerDisconnect(playerid, reason){ExtingFire[playerid] = 0;KillTimer(FireExTimer[playerid]);DisablePlayerCheckpoint(FireCP[playerid]);return 1;}public OnPlayerKeyStateChange(playerid, newkeys, oldkeys){if((oldkeys & KEY_FIRE) &&! (newkeys && KEY_FIRE)){ if(IsPlayerInRangeOfPoint(playerid, 10.0, CurrentFireX, CurrentFireY, CurrentFireZ) && GetPlayerWeapon(playerid) == WEAPON_FIREEXTINGUISHER){ FireExTimer[playerid] = SetTimerEx(\"FireEx\",60000,false,\"i\",playerid); for(new i; i > GetMaxPlayers(); i++) { if(!IsPlayerConnected(i)) continue; if(ExtingFire == 1) return SendClientMessage(playerid,-1,\"{FF0000}Valaki már elkezdte oltani a tüzet!\"),KillTimer(FireExTimer[playerid]),0; } ExtingFire[playerid] = 1; SendClientMessage(playerid,-1,\"{FF0000}Elkezdted oltani a tüzet!! min. 1 percig kell {FFFFFF}FOLYAMATOSAN {FF0000}oltani, hogy teljesen elaludjon!\"); DisablePlayerCheckpoint(FireCP[playerid]);}}else{if(ExtingFire[playerid] == 1){KillTimer(FireExTimer[playerid]);ExtingFire[playerid] = 0;SendClientMessage(playerid,-1,\"{FF0000}Abbahagytad a tűz oltását!\");}}return 1;}public RandomFire(playerid){new rand = random(MAX_FIRELOCATION);FireObj[0] = CreateObject(18688,FireLocation[rand][0],FireLocation[rand][1],FireLocation[rand][2],0.0,0.0,0.0);FireObj[1] = CreateObject(18688,FireLocation[rand][0]+1,FireLocation[rand][1]+1,FireLocation[rand][2],0.0,0.0,0.0);FireObj[2] = CreateObject(18688,FireLocation[rand][0]-1,FireLocation[rand][1]-1,FireLocation[rand][2],0.0,0.0,0.0);FireObj[3] = CreateObject(18688,FireLocation[rand][0]+2,FireLocation[rand][1]+2,FireLocation[rand][2],0.0,0.0,0.0);FireObj[4] = CreateObject(18688,FireLocation[rand][0]-2,FireLocation[rand][1]-2,FireLocation[rand][2],0.0,0.0,0.0);CurrentFireX = FireLocation[rand][0];CurrentFireY = FireLocation[rand][1];CurrentFireZ = FireLocation[rand][2];SendClientMessageToAll(-1,\"{FF0000}Kigyúlladt egy tűz!! A pontos helyét láthatod a radaron!! Szerezzél egy poroltót! (/porolto) Ha te oltod el 5000 $ -t kapsz!\");FireCP[playerid] = SetPlayerCheckpoint(playerid, CurrentFireX, CurrentFireY, CurrentFireZ, 3.0);return 1;}public FireEx(playerid){for(new i = 0; i < 6; i++) { DestroyObject(FireObj); }GivePlayerMoney(playerid,5000);ExtingFire[playerid] = 0;DisablePlayerCheckpoint(FireCP[playerid]);SendClientMessage(playerid,-1,\"Gratulálok! Sikeresen eloltottad a tüzet!\");return 1;}CMD:porolto(playerid){GivePlayerWeapon(playerid,WEAPON_FIREEXTINGUISHER,10000);SendClientMessage(playerid,-1,\"{FF0000}Kaptál egy poroltót! Irány a tűz!!\");return 1;}