SA-MP Forums Archive
Weather control.. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Weather control.. (/showthread.php?tid=466453)



Weather control.. - CesarLT - 27.09.2013

Hello everyone, I am wondering, how can I create a CMD, to control the weather. (IDS, and time.)
I am sort of new to scripting, and this is an unknown area for me.
Thanks in advance.


Re: Weather control.. - RedWolfX - 27.09.2013

This is taken directly from script.

pawn Код:
CMD:setweather(playerid,params[])
    {
        new string[128];
        new sendername[MAX_PLAYER_NAME];
        new weather;
        if(sscanf(params, "d", weather))
        return SendClientMessage(playerid, RED, "/setweather [Weather ID]");
        if(PlayerInfo[playerid][pAdmin] < 4)
        return SendClientMessage(playerid, RED, "You are not high admin enough");
        {
            SetWeather(weather);
            SendClientMessage(playerid, RED, "The weather has been changed");
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, 256, "[ADMIN] %s has changed the weather to %d.", sendername,weather);
            aMessage(COLOR_YELLOW,string,1);
        }
        return 1;
    }
Just as an example


Re: Weather control.. - CesarLT - 27.09.2013

Quote:
Originally Posted by RedWolfX
Посмотреть сообщение
This is taken directly from script.

pawn Код:
CMD:setweather(playerid,params[])
    {
        new string[128];
        new sendername[MAX_PLAYER_NAME];
        new weather;
        if(sscanf(params, "d", weather))
        return SendClientMessage(playerid, RED, "/setweather [Weather ID]");
        if(PlayerInfo[playerid][pAdmin] < 4)
        return SendClientMessage(playerid, RED, "You are not high admin enough");
        {
            SetWeather(weather);
            SendClientMessage(playerid, RED, "The weather has been changed");
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, 256, "[ADMIN] %s has changed the weather to %d.", sendername,weather);
            aMessage(COLOR_YELLOW,string,1);
        }
        return 1;
    }
Just as an example
Ow, I see, well that makes things a bit more clear. Thank you.
It's always awsome to learn new stuff


Re: Weather control.. - RedWolfX - 27.09.2013

No problem Are you using strcmp or zcmd or any other command proccesor?
I can help you create a cmd


Re: Weather control.. - CesarLT - 28.09.2013

Quote:
Originally Posted by RedWolfX
Посмотреть сообщение
No problem Are you using strcmp or zcmd or any other command proccesor?
I can help you create a cmd
I am using ZCMD, and as I said, I am new to scripting.
It's my first week, but am getting the catch of things pretty much fast, if you could teach me anything, that'll be great.