Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define FILTERSCRIPT
- #include a_samp
- #include zcmd
- #define MAX_SNOW 4
- #define function%0(%1) forward%0(%1);public%0(%1)
- new Hav[MAX_PLAYERS][MAX_SNOW], Float:sPos[3];
- public OnFilterScriptExit() {
- for(new x=0; x < MAX_PLAYERS; x++) {
- for(new i = 0; i < MAX_SNOW; i++) DestroyPlayerObject(x, Hav[x][i]);
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason) {
- if(GetPVarInt(playerid, "Havazas")) cmd_havazaski(playerid);
- return 1;
- }
- CMD:havazas(playerid) {
- if(GetPVarInt(playerid, "Havazas")) return SendClientMessage(playerid, 0xff0000ff, "Hiba! Neked már be van állítva a hóesés!");
- SetPVarInt(playerid, "Havazas", 1);
- SetPVarInt(playerid, "SnowTimer", SetTimerEx("Snow", 600, true, "i", playerid));
- GetPlayerPos(playerid, sPos[0], sPos[1], sPos[2]);
- for(new i = 0; i < MAX_SNOW; i++) Hav[playerid][i] = CreatePlayerObject(playerid, 18864, sPos[0] + random(20), sPos[1] + random(20), sPos[2] + random(5)+1, random(360), random(360), random(360), 0.0);
- SetPlayerTime(playerid, 0, 0);
- SendClientMessage(playerid, -1, "Jelenlegi időjárás: Havazás (Kikapcsolás: /havazaski)");
- return 1;
- }
- CMD:havazaski(playerid) {
- if(!GetPVarInt(playerid, "Havazas")) return SendClientMessage(playerid, 0xff0000ff, "Hiba! Neked nincs beállítva havazás!");
- SetPVarInt(playerid, "Havazas", 0);
- for(new i = 0; i < MAX_SNOW; i++) DestroyPlayerObject(playerid, Hav[playerid][i]);
- KillTimer(GetPVarInt(playerid, "SnowTimer"));
- SetPlayerTime(playerid, 12, 0);
- SendClientMessage(playerid, -1, "Havazás megszakítva!");
- return 1;
- }
- CMD:havazasall(playerid) {
- if(!IsPlayerAdmin(playerid)) return 0; // Ha nem vagy RCON admin akkor erre a parancsra UNKNOW COMMAND-ot ír.
- for(new x=0; x < MAX_PLAYERS; x++) {
- if(!GetPVarInt(x, "Havazas")) cmd_havazas(x);
- }
- SendClientMessageToAll(-1, "Havazás mindenkinek elindítva admin által! (Kikapcsolás: /havazasallki)");
- return 1;
- }
- CMD:havazasallki(playerid) {
- if(!IsPlayerAdmin(playerid)) return 0; // Ha nem vagy RCON admin akkor erre a parancsra UNKNOW COMMAND-ot ír.
- for(new x=0; x < MAX_PLAYERS; x++) {
- if(GetPVarInt(x, "Havazas")) cmd_havazaski(x);
- }
- SendClientMessageToAll(0xff0000ff, "Havazás mindenkinek kikapcsolva admin által!");
- return 1;
- }
- function Snow(playerid) {
- if(GetPVarInt(playerid, "Havazas")) {
- GetPlayerPos(playerid, sPos[0], sPos[1], sPos[2]);
- for(new i = 0; i < MAX_SNOW; i++) Hav[playerid][i] = SetPlayerObjectPos(playerid, 18864, sPos[0] + random(20), sPos[1] + random(20), sPos[2] + random(5)+1);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement