Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Red Balloons
- new TIMER_REDBALLOONS;
- new TIMER_REDBALLOONSEND;
- new RedBalloon[99];
- new bool:WaitBalloons = false;
- CMD:redballoons(playerid, params[])
- {
- if(pInfo[playerid][pAdmin] < 6) return SCM(pid,COLOR_GREY,ERROR);
- if(WaitBalloons == true) return SCM(playerid, -1, "WAIT NIGGA");
- new version;
- if(sscanf(params, "i", version)) return SCM(playerid, -1, "USAGE: /redballoons [version] (1 = English, 2 = Rock)");
- if(version == 1)
- {
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(!IsPlayerConnected(i)) continue;
- PlayAudioStreamForPlayer( i, "http://puu.sh/lzJYC/8ceff343e7.mp3" );
- SCM(i, COLOR_WHITE, "Use /stopstream to end the music stream.");
- }
- }
- else if(version == 2)
- {
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(!IsPlayerConnected(i)) continue;
- PlayAudioStreamForPlayer( i, "http://puu.sh/lzKfC/ea33ff3354.mp3" );
- SCM(i, COLOR_WHITE, "Use /stopstream to end the music stream.");
- }
- }
- else return SCM(playerid, -1, "Version doesnt exist");
- WaitBalloons = true;
- TIMER_REDBALLOONS = SetTimerEx("RedBalloons", 500, true, "i", playerid);
- return 1;
- }
- forward RedBalloons(playerid);
- public RedBalloons(playerid)
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- new randX = random(45);
- new randY = random(45);
- new randZ = random(20);
- new randA = random(360);
- new randSignX = random(100);
- new randSignY = random(100);
- new randSignZ = random(100);
- new Float:fx, Float:fy, Float:fz;
- if(randSignX > 49)
- {
- fx = x + randX;
- }
- else fx = x - randX;
- if(randSignY > 49)
- {
- fy = y + randY;
- }
- else fy = y - randY;
- if(randSignZ > 49)
- {
- fz = z + randZ;
- }
- else fz = z - randZ;
- for(new i=0; i<99; i++)
- {
- if(!IsValidDynamicObject(RedBalloon[i]))
- {
- RedBalloon[i] = CreateDynamicObject(19091, fx, fy, fz, 0.00000, -90.00000, randA);
- MoveDynamicObject(RedBalloon[i], fx, fy, fz + 600, 0.6, 0, -90, randA);
- return 1;
- }
- if(i == 98)
- {
- TIMER_REDBALLOONSEND = SetTimer("RedBalloonsEnd", 200000, false);
- KillTimer(TIMER_REDBALLOONS);
- }
- }
- return 1;
- }
- forward RedBalloonsEnd();
- public RedBalloonsEnd()
- {
- for(new i=0; i<99; i++)
- {
- DestroyDynamicObject(RedBalloon[i]);
- }
- WaitBalloons = false;
- KillTimer(TIMER_REDBALLOONSEND);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment