[FilterScript] Raimbow Man [Skin change with time]
#5

Faster and simpler, also not a new idea!

pawn Код:
include <a_samp>

new TimerOn[MAX_PLAYERS],Timer[MAX_PLAYERS];

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/rainbowman", cmdtext, true, 14) == 0)
    {
        if(TimerOn[playerid]==0)
        {
            SendClientMessage(playerid,-1, "Rainbow Man has been turned on.");
            Timer[playerid] = SetTimerEx("Skin", 1000, 0, "d" ,playerid);
            TimerOn[playerid]=1;
        }
        else
        {
            SendClientMessage(playerid,-1, "Rainbow Man has been turned off.");
            KillTimer(Timer[playerid]);
            TimerOn[playerid]=0;
        }
    }
    return 0;
}

forward Skin(playerid);
public Skin(playerid)
{
    SetPlayerSkin(playerid,random(299));
    TogglePlayerControllable(playerid,1); //Otherwise it will freeze and bug you!
    return 1;
}
You have to much useless Code in this Script. Starting many Timers != great for server performance. Also is Littlehelper[MDZ] correct. It would work only for one person.
Reply


Messages In This Thread
Raimbow Man [Skin change with time] - by sirvasy - 25.05.2013, 16:47
Re: Raimbow Man [Skin change with time] - by Littlehelper - 25.05.2013, 16:55
Re: Raimbow Man [Skin change with time] - by sirvasy - 25.05.2013, 17:00
Re: Raimbow Man [Skin change with time] - by Abhishek. - 25.05.2013, 17:02
AW: Raimbow Man [Skin change with time] - by ulbi1990 - 25.05.2013, 17:34
Re: Raimbow Man [Skin change with time] - by Littlehelper - 25.05.2013, 18:59
Re: Raimbow Man [Skin change with time] - by BpVanshVk - 25.05.2013, 22:19
Re: Raimbow Man [Skin change with time] - by Deron_Green - 26.05.2013, 20:04
Re: Raimbow Man [Skin change with time] - by Alex Magaсa - 26.05.2013, 20:12
Re: Raimbow Man [Skin change with time] - by sirvasy - 28.05.2013, 20:15

Forum Jump:


Users browsing this thread: 1 Guest(s)