SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 30/01/2015, 03:59 PM   #1
DukeVega
Big Clucker
 
Join Date: Jul 2014
Posts: 86
Reputation: 5
Default Issue with sound repeating + Textdraw error on FS

I am working on a radiation script that basically does three things

1 - Displays a Textdraw

2 - Has multiple locations

3 - plays a sound file


The Errors I am having are as follows


a - Textdraw comes up as a different textdraw from the gamemode (they have different labels, i labeled this one 8 one in GM is 0)

b - the sound file automatically hits play every second, therfor it spams the screen and doesnt play in full (its 9 seconds long) - i am guessing i need some kind of pause?



// Radiation Area With Textdraw Created By AndrewGrob
// When You Enter The Area, A Textdraw Will Show & Warn You To Leave
// The Textdraw Will Dissapear After 10 Seconds. Enjoy
// I Have Also Made A Goto/Teleport Command, It Will Teleport You To The Area
// Type In /ra To Go To The Radiation Area
// Just Remove It. Its Only Needed To Test The Script
// The Area Is 90 Radius so you will have to change it to 20 To Test It Faster
// Find---- if(IsPlayerInRangeOfPoint(i, 90.0, -1514.6758,2520.2603,55.9311)) {
// Change 90.0 To 20.0 For Testing Only!
#include <a_samp>
#define Black 0x000000AA
#define Red 0xAA3333AA
new Text:Textdraw8;
forward radiationarea();
forward textdrawtimer(playerid);
public OnFilterScriptInit()
{
SetTimer("radiationarea", 1000, 1);
Textdraw8= TextDrawCreate(300, 200,"RADIATION ZONE");
TextDrawAlignment(Textdraw8,2);
TextDrawBackgroundColor(Textdraw8,Black);
TextDrawFont(Textdraw8,2);
TextDrawLetterSize(Textdraw8,0.3,1.2);
TextDrawColor(Textdraw8,Red);
TextDrawSetOutline(Textdraw8,1);
TextDrawSetProportional(Textdraw8,1);
TextDrawSetShadow(Textdraw8,1);
return 1;
}

public radiationarea()
{
for(new i = 0; i <= MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) {
if(IsPlayerInRangeOfPoint(i, 20.0, -1514.6758,2520.2603,55.9311)) {
new Float:helf;
GetPlayerHealth(i, helf);
SetPlayerHealth(i, helf-3);
TextDrawShowForPlayer(i,Textdraw;
SetTimer("textdrawtimer", 10000, 1);
PlayAudioStreamForPlayer(i, "http://xenopixel.net/wp-content/uploads/2015/01/Geiger-counter-small.mp3");

}
if(IsPlayerInRangeOfPoint(i, 20.0, -1380.5601,2601.1104,55.1582)) {
new Float:helf;
GetPlayerHealth(i, helf);
SetPlayerHealth(i, helf-3);
TextDrawShowForPlayer(i,Textdraw;
SetTimer("textdrawtimer", 10000, 1);
}
if(IsPlayerInRangeOfPoint(i, 20.0, -1380.5601,2601.1104,55.1582)) {
new Float:helf;
GetPlayerHealth(i, helf);
SetPlayerHealth(i, helf-3);
TextDrawShowForPlayer(i,Textdraw;
SetTimer("textdrawtimer", 10000, 1);
}
if(IsPlayerInRangeOfPoint(i, 20.0, -1380.5601,2601.1104,55.1582)) {
new Float:helf;
GetPlayerHealth(i, helf);
SetPlayerHealth(i, helf-3);
TextDrawShowForPlayer(i,Textdraw;
SetTimer("textdrawtimer", 10000, 1);
}
if(IsPlayerInRangeOfPoint(i, 20.0, -1380.5601,2601.1104,55.1582)) {
new Float:helf;
GetPlayerHealth(i, helf);
SetPlayerHealth(i, helf-3);
TextDrawShowForPlayer(i,Textdraw;
SetTimer("textdrawtimer", 10000, 1);
}

return 1;
}
}
return 0;
}

public textdrawtimer(playerid)
{
TextDrawHideForPlayer(playerid,Textdraw;
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/ra", cmdtext, true, 2) == 0)
{
SetPlayerPos(playerid, -1514.6758,2520.2603,55.9311);
return 1;
}
return 0;
}




















Much thanks Duke <3
DukeVega is offline   Reply With Quote
Old 30/01/2015, 04:02 PM   #2
DukeVega
Big Clucker
 
Join Date: Jul 2014
Posts: 86
Reputation: 5
Default Re: Issue with sound repeating + Textdraw error on FS

Totally just noticed that i posted this in the wrong section* apolagies
DukeVega is offline   Reply With Quote
Old 30/01/2015, 04:05 PM   #3
Admigo
High-roller
 
Admigo's Avatar
 
Join Date: Oct 2010
Location: The Netherlands
Posts: 1,840
Reputation: 297
Default Re: Issue with sound repeating + Textdraw error on FS

I think its better to post your problem here: http://forum.sa-mp.com/showthread.php?t=560123
__________________
Follow me on Instagram @brandonvanommen
Admigo is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sound issue WillyP Everything and Nothing 6 22/06/2013 07:36 PM
sound issue Help please!!!!!! stlane Everything and Nothing 3 11/10/2012 01:45 PM
ID Repeating issue Abreezy Scripting Help 4 23/01/2012 08:22 PM
Helicopter sound issue gravedigger69 Client Support 2 19/11/2011 11:01 PM
[HELP] Sound issue WThieves Help Archive 8 15/12/2009 07:51 PM


All times are GMT. The time now is 07:41 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.