Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- #include <sscanf2>
- #define DEFAULTTIME 500 //Hier definieren was der Standard wert ist für die Timer (MS)
- #define MINTIME 50 //Hier definieren was das mindest erlaubte ist an Zeit (MS) für die Timer
- enum TrollEnum
- {
- RainbowActive,
- RainbowActiveTime,
- RainbowActiveTimer,
- RainbowAllActive,
- RainbowAllActiveStarter
- }
- new tInfo[MAX_PLAYERS][TrollEnum];
- public OnFilterScriptInit()
- {
- print(" ");
- print("\t\t|=============================|");
- print("\t\t|uFun - Have fun with trolling|");
- print("\t\t| scripted by ulbi1990 |");
- print("\t\t|=============================|");
- print(" ");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("uFun wurde erfollgreich vom Server entladen!");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- tInfo[playerid][RainbowActiveTime]=DEFAULTTIME;
- return 1;
- }
- public OnPlayerDisconnect(playerid,reason)
- {
- if(tInfo[playerid][RainbowAllActiveStarter]==playerid)
- {
- KillTimer(tInfo[playerid][RainbowActiveTimer]);
- for(new i;i<GetMaxPlayers();i++)
- {
- tInfo[i][RainbowAllActive]=0;
- }
- SendClientMessageToAll(-1,"Rainbowall wurde gestoppt!");
- }
- return 1;
- }
- CMD:rainbowtime(playerid,params[])
- {
- new time,str[128];
- if(sscanf(params,"d",time)) return SendClientMessage(playerid,-1,"[NUTZUNG]: /rainbowtime [Zeit in Ms]");
- {
- if(time<50) return SendClientMessage(playerid,-1,"Nicht weniger als 50 MS!");
- {
- tInfo[playerid][RainbowActiveTime]=time;
- format(str,sizeof(str),"Du hast den Timer auf '%d' ms gestellt!",tInfo[playerid][RainbowActiveTime]);
- SendClientMessage(playerid,-1,str);
- }
- }
- return 1;
- }
- CMD:rainbow(playerid,params[])
- {
- if(GetPlayerVehicleSeat(playerid)==0)
- {
- if(tInfo[playerid][RainbowAllActive]==0)
- {
- if(tInfo[playerid][RainbowActive]==0)
- {
- tInfo[playerid][RainbowActiveTimer]=SetTimerEx("RainbowTimer",tInfo[playerid][RainbowActiveTime],1,"i",playerid);
- SendClientMessage(playerid,-1,"Zum stoppen von Rainbow erneute eingabe des Befehles!");
- tInfo[playerid][RainbowActive]=1;
- }
- else if(tInfo[playerid][RainbowActive]==1)
- {
- KillTimer(tInfo[playerid][RainbowActiveTimer]);
- SendClientMessage(playerid,-1,"Rainbow wurde gestoppt!");
- tInfo[playerid][RainbowActive]=0;
- }
- }
- }
- return 1;
- }
- CMD:rainbowall(playerid,params[])
- {
- if(tInfo[playerid][RainbowAllActive]==0)
- {
- tInfo[playerid][RainbowActiveTimer]=SetTimer("RainbowTimer",tInfo[playerid][RainbowActiveTime],1);
- tInfo[playerid][RainbowAllActiveStarter]=playerid;
- SendClientMessageToAll(-1,"Rainbowall wurde gestartet!");
- for(new i;i<GetMaxPlayers();i++)
- {
- tInfo[i][RainbowAllActive]=1;
- }
- }
- else
- {
- if(tInfo[playerid][RainbowAllActiveStarter]==playerid)
- {
- KillTimer(tInfo[playerid][RainbowActiveTimer]);
- for(new i;i<GetMaxPlayers();i++)
- {
- tInfo[i][RainbowAllActive]=0;
- }
- SendClientMessageToAll(-1,"Rainbowall wurde gestoppt!");
- }
- }
- return 1;
- }
- forward RainbowTimer(playerid);
- public RainbowTimer(playerid)
- {
- if(tInfo[playerid][RainbowAllActive]==0)
- {
- ChangeVehicleColor(GetPlayerVehicleID(playerid),random(9999),random(9999));
- }
- else if(tInfo[playerid][RainbowAllActive]==1)
- {
- for(new i;i<MAX_VEHICLES;i++)
- {
- ChangeVehicleColor(i,random(9999),random(9999));
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment