Gang Zone Turfs [HELP]
#1

Now I want to script a turf area, which I know how to do. Now I want to add a pickup icon which I also can do... But what I want is : When the player enter's the icon, the gang zone flashes, but he must only stay at that spot for 25 seconds. If he is out of InPlayerRangePoint it turns back to normal gang color. So now this is what I want to do. But can someone who has the time to please show me with 3 gang's and the area's and the pickup's and how it works. But give fake coordinates... that I will do. Ex. IfIsPlayerInPoint(playerid, ......);

Please anyone who helps me, get's reputation!
Reply
#2

I've been gone for about 4 hours... nobody replied.
Reply
#3

Apparently Mademan created a tutorial to show the concept of making this, check it out.
Reply
#4

Code:
#define FILTERSCRIPT

#include <a_samp>

// ----- Variables

#define MAX_GANGZONES   15

new Checkpoint[MAX_PLAYERS];
new GroveTurf;
new timer;

// ----- Callbacks

public OnFilterScriptInit()
{
	GroveTurf = GangZoneCreate(2402.546, -1737.13, 2604.096, -1630.541); // Creating the GangZone
	GangZoneShowForAll(GroveTurf, 0x00FF007A);
	return 1;
}

public OnFilterScriptExit()
{
	GangZoneDestroy(GroveTurf);
	return 1;
}

public OnPlayerSpawn(playerid)
{
    SetPlayerCheckpoint(playerid, 2487.0391,-1668.5784,13.3438,8);
	SetPlayerColor(playerid, 0xFF80FFFF); // Pink
	return 1;
}

public OnPlayerEnterCheckpoint(playerid) // If the player enters a particluar checkpoint
{
	SendClientMessage(playerid, 0x00FF007A, "Please Wait 20 Seconds - To Caputre this turf."); // Telling the player to wait 20 seconds.
	GangZoneFlashForAll(GroveTurf,  0xFF80FF76); // Makes the turf Flash Pink ( telling everyone its being taken over )
	SendClientMessageToAll(0xFF80FFFF, "The Grove Street Turf is being taken over"); // Sending Message to all players.
	timer = SetTimerEx("SetZone", 20000, false, "i", playerid); // Setting the Timer... ( 20 seconds )
	Checkpoint[playerid] = 1; // Telling the variable that the player is in the checkpoint.
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	if(Checkpoint[playerid] == 1)
	{
		SendClientMessage(playerid, 0x00FF007A, "ERROR : You have left the checkpoint");
		GangZoneStopFlashForAll(GroveTurf);
		SendClientMessageToAll(0x00FF007A, "The Grove Street Turf is now safe");
		KillTimer(timer);
		Checkpoint[playerid] = 0;
	}
	else
	{
	    // nothing
	}
	return 1;
}

// Custom Callbacks

forward SetZone(playerid);
public SetZone(playerid)
{
	if(Checkpoint[playerid] == 1)
	{
		GangZoneStopFlashForAll(GroveTurf); // Stopping it Flashing.
		GangZoneHideForAll(GroveTurf); // Hiding the GangZone
		GangZoneShowForAll(GroveTurf, 0xFF80FF76); // Showing the GangZone with the new colour
		SendClientMessageToAll(0x00FF007A, "The Grove Street Turf, has been sucessfully taken over");
		Checkpoint[playerid] = 0;
		// You could delete the check point then make it spawn again in 10 minutes or something...
	}
	return 1;
}
Reading what you've put that should do what you want it too... just have to edit some parts to fit what you want.
Reply
#5

Thanks Shadow Bro. Thanks for the other for replying.
Reply
#6

Ok, If in my script I don't set the color's in OnPlayerSpawn, I set them when they are requesting a class. So the color is given. Here you show a example Pink. Now how do I do this but can you show me with 3 gang's...? See my point is how to do it with many other gang's?

Must I use when OnPlayerEnterCheckpoint... use skin id like : IsPlayerSkin blah.... blah blah... then only the color of the gang will come.

Another question is, if I want to add IsPlayerSkin, can I add more than one skin. Ex: IsPlayerSkin > 280, (more) (more).. Is it possible?
Reply
#7

Ok, Shadow your tutorial was good and understanding. Now I also read about Mademan's tutorial. My question is, you did OnPlayerSpawn... you gave the color Pink. In my script, The color is given while they are browsing through classes. So, OnPlayerCheckpoint... how do I make it like GetPlayerColor....? The thing get's the player color and flashes that color. So how do I do that?
Reply
#8

Use the search option and click advanced, select the tutorial prefer type this: how to make gangzones
Reply
#9

See, I check it out. It show's how to create gangzones. I know how to do! I want to make gangzones catchable. Now about, I'm asking for the color thing. A code like ... GetPlayerColor and when the PlayerEnterCheckpoint it flashes that color. So how to do that?
Reply
#10

@ Shadow. I like it. Its nice. It helped me out.

Now to all professional scripter's, can someone show me the pawn code on how to do something like Shadow did with some team's and not only one skin. Another thing is when the player is capturing a turf, how to create a small loading bar above the map... (like a loading bar.) to show how much time left till the turf is captured. If you go and play at this server : 94.23.6.53:7777 . When you capturing a land, that red loading bar will appear. How to create that with this... ?
Reply
#11

Anyone? Please reply quick, cause I'm scripting now.
Reply
#12

Please someone help. There must be someone who has scripted something like this...
Reply
#13

Hell, stop bumping your damn thread after 1 day or a few hours! Do you even know what you're asking us? You want US to script YOU a GIGANTIC piece of code! Go into the script-request thread or use the search-function! Now stop the bumping, if you need it that badly, then go and "rent" yourself a private scripter!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)