SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 14/10/2009, 02:35 AM   #1
caribe88
Big Clucker
 
Join Date: Apr 2008
Posts: 180
Reputation: 0
Default Help with Gang Zones

Hi everybody:
I made for my TDM Server a script that when you take a pickup the zone changes the color to the gang you're in.
It works perfect but the problem right now is, for example Killers have taken over the Workers zone and a new Player Joins the server and selects Workers, the gang zone changes the color to Workers again like it was in the begging, so the killers have to get the pick up again to change it to their color.
I made it with GangzoneShowForAll otherwise it would show for one player only in the team, here is the code to understand it better.

Thats under on player spawn
Code:
public OnPlayerSpawn(playerid){
	if(gTeam[playerid] == TEAM_TRABAJADORES) {
	GangZoneShowForAll(Trabajadores,COLOR_GREEN);
	SetPlayerColor(playerid,COLOR_GREEN); // GREEN
	GivePlayerWeapon(playerid, 6,1);
	GivePlayerWeapon(playerid, 22,250);
	GivePlayerWeapon(playerid, 25,250);
	GivePlayerWeapon(playerid, 32,450);
	GivePlayerWeapon(playerid, 30,250);
		}

	else if(gTeam[playerid] == TEAM_EMPRESARIOS) {
	GangZoneShowForAll(Empresarios,COLOR_PURPLE);
	SetPlayerColor(playerid,COLOR_PURPLE); // PURPLE
	GivePlayerWeapon(playerid, 2,1);
	GivePlayerWeapon(playerid, 23,250);
	GivePlayerWeapon(playerid, 25,250);
	GivePlayerWeapon(playerid, 28,450);
	GivePlayerWeapon(playerid, 30,250);
		}
	return 1;}
Thats under onplayerpickup
Code:
public OnPlayerPickUpPickup(playerid, pickupid)
{
	if (pickupid == zonatrabaj && gTeam[playerid] == TEAM_TRABAJADORES){
	GangZoneShowForAll(Trabajadores,COLOR_GREEN);
 	}
	if (pickupid == zonatrabaj && gTeam[playerid] == TEAM_EMPRESARIOS){
	GangZoneShowForAll(Trabajadores,COLOR_PURPLE);
 	}
	return 1;
 }
What i want is that when a player spawns the zone stays the same color as it as taken from the killers
If somebody could help me out would be very nice
Thanks
caribe88 is offline  
Old 14/10/2009, 11:28 AM   #2
klavins
Big Clucker
 
Join Date: Jul 2009
Posts: 56
Reputation: 13
Default Re: Help with Gang Zones

try removing `GangZoneShowForAll` from onplayer spawn
klavins is offline  
Old 14/10/2009, 01:56 PM   #3
caribe88
Big Clucker
 
Join Date: Apr 2008
Posts: 180
Reputation: 0
Default Re: Help with Gang Zones

if i do it the gang zones doesn't appear, only after i grab the pickup but still not for the players that conect only those who are conected
caribe88 is offline  
Old 14/10/2009, 03:12 PM   #4
Jakku
High-roller
 
Jakku's Avatar
 
Join Date: Apr 2009
Location: Heinola, Finland
Posts: 1,354
Reputation: 157
Default Re: Help with Gang Zones

Use GangZoneShowForPlayer, not GangZoneShowForAll
__________________
Jakku is offline  
Old 14/10/2009, 03:26 PM   #5
caribe88
Big Clucker
 
Join Date: Apr 2008
Posts: 180
Reputation: 0
Default Re: Help with Gang Zones

Quote:
Originally Posted by Jakku
Use GangZoneShowForPlayer, not GangZoneShowForAll
Like i said GangZoneShowForPlayer only shows to the player who gets the pickup the same with the spawn, it will show green to the player who conects to the server not for the other players that already connected that's why I used GangZoneShowForAll

What im thinking is put a code like this

Code:
public OnPlayerSpawn(playerid){
	if(gTeam[playerid] == TEAM_TRABAJADORES) {
     if(Zonetrabajtaken[playerid] == 0) return GangZoneShowForPlayer(playerid,Trabajadores,COLOR_GREEN);
return 1;}
Under onplayerpickup
Code:
	if (pickupid == zonatrabaj && gTeam[playerid] == TEAM_TRABAJADORES){
	GangZoneShowForAll(Trabajadores,COLOR_GREEN);
    Zonetrabajtaken[playerid] == 0
 	}
	if (pickupid == zonatrabaj && gTeam[playerid] == TEAM_EMPRESARIOS){
	GangZoneShowForAll(Trabajadores,COLOR_PURPLE);
    Zonetrabajtaken[playerid] == 1
 	}
If I'm not wrong it should work I have to try it out
I don't know what you guys suggest
caribe88 is offline  
 

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
Gang Zones BLAbla93 Help Archive 2 21/04/2010 02:49 AM
[HELP]Problems with Gang Zones sushihusi Help Archive 7 07/03/2010 04:54 PM
[duv] gang zones nao aparecem xolp25 PortuguÍs/Portuguese 2 07/01/2010 04:26 PM
Gang Zones V1ceC1ty Help Archive 5 23/09/2009 08:59 AM
A little problem with gang zones (only create gang zones) CTCCoco Help Archive 4 20/02/2009 10:59 AM


All times are GMT. The time now is 08:40 AM.


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