Can someone make a short script for me please??
#1

Hi peeps,


I am very new to scripting and althoug h ican do basic edits i struggle on anything of real depth!

https://sampforum.blast.hk/showthread.php?tid=560123


The above link is a recent issue of a Radiation Script .


I need this script to do 2 things


1 - have multiple locations

2 - play a sound file when player enters one of the areas. (on loop)
2b - stop playing sound file if not in area


// 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:Textdraw0;
forward radiationarea();
forward textdrawtimer(playerid);
public OnFilterScriptInit()
{
SetTimer("radiationarea", 1000, 1);
Textdraw0= TextDrawCreate(300, 200,"Contaminated Area , Leave");
TextDrawAlignment(Textdraw0,2);
TextDrawBackgroundColor(Textdraw0,Black);
TextDrawFont(Textdraw0,2);
TextDrawLetterSize(Textdraw0,0.3,1.2);
TextDrawColor(Textdraw0,Red);
TextDrawSetOutline(Textdraw0,1);
TextDrawSetProportional(Textdraw0,1);
TextDrawSetShadow(Textdraw0,1);
return 1;
}

public radiationarea()
{
for(new i = 0; i <= MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) {
if(IsPlayerInRangeOfPoint(i, 90.0, -1514.6758,2520.2603,55.9311)) {
new Float:helf;
GetPlayerHealth(i, helf);
SetPlayerHealth(i, helf-5);
TextDrawShowForPlayer(i,Textdraw0);
SetTimer("textdrawtimer", 10000, 1);
}
return 1;
}
}
return 0;
}

public textdrawtimer(playerid)
{
TextDrawHideForPlayer(playerid,Textdraw0);
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;
}















Thankyou for your help


Duke Vega <3
wwww.xenopixel.net
Reply
#2

This is a section to get help with your script, or with scripting in general, not to request scripts.

You can easily loop through all players and check with
pawn Код:
if(IsPlayerInRangeOfPoint(i, 90.0, -1514.6758,2520.2603,55.9311))
Then use PlayAudioStreamForPlayer to play a sound, and StopAudioStreamForPlayer to stop the sound.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)