[HELP] Player Leave's Capture Zone!
#1

When the player leaves the capture zone , then the flash will stop.
But ! its still flashing and still capturing when the player leaves the zone

Here's the code :

Код:
public OnPlayerLeaveDynamicCP(playerid, checkpointid)
{
    for(new x=0; x < sizeof(CP); x++)
    {
        if(checkpointid == CP[x])
        {
            if(Captured[x] == 1)
            {
                GangZoneStopFlashForAll(Zone[x]);
	            UnderAttack[x] = 0;
	            InCP[playerid] = 0;
	            tCP[x] = gTeam[playerid];
	            switch(gTeam[playerid])
	            {
	                case TEAM_USA: GangZoneShowForAll(Zone[x], COLOR_LIGHTERBLUE);
	                case TEAM_RUSS: GangZoneShowForAll(Zone[x], COLOR_RED);
	                case TEAM_ARAB: GangZoneShowForAll(Zone[x], COLOR_ORANGELIGHT);
	                case TEAM_EURO: GangZoneShowForAll(Zone[x], COLOR_GREENLIGHT);
	                case TEAM_REBELS: GangZoneShowForAll(Zone[x], COLOR_BROWNLIGHT);
	                case TEAM_ASIA: GangZoneShowForAll(Zone[x], COLOR_YELLOW);
	            }
			}
		}
	}
    return 1;
}
Reply
#2

Hello!

What is printing in the console (server.log) here?
PHP код:
public OnPlayerLeaveDynamicCP(playeridcheckpointid)
{
    for(new 
x=0sizeof(CP); x++)
    {
        
printf("checkpointid: %i - CP[%i] = %i",checkpointid,x,CP[x]);
        if(
checkpointid == CP[x])
        {
            
printf("Captured[%i] == %i",x,Captured[x]);
            if(
Captured[x] == 1)
            {
                
printf("FlashStop");
                
GangZoneStopFlashForAll(Zone[x]);
                
UnderAttack[x] = 0;
                
InCP[playerid] = 0;
                
tCP[x] = gTeam[playerid];
                switch(
gTeam[playerid])
                {
                    case 
TEAM_USAGangZoneShowForAll(Zone[x], COLOR_LIGHTERBLUE);
                    case 
TEAM_RUSSGangZoneShowForAll(Zone[x], COLOR_RED);
                    case 
TEAM_ARABGangZoneShowForAll(Zone[x], COLOR_ORANGELIGHT);
                    case 
TEAM_EUROGangZoneShowForAll(Zone[x], COLOR_GREENLIGHT);
                    case 
TEAM_REBELSGangZoneShowForAll(Zone[x], COLOR_BROWNLIGHT);
                    case 
TEAM_ASIAGangZoneShowForAll(Zone[x], COLOR_YELLOW);
                }
            }
        }
    }
    return 
1;

- Mencent
Reply
#3

I will copy that code ?
Reply
#4

Yes, you should replace the code. Then you should send us the prints which are creating in the server.log after you test it in game.


- Mencent
Reply
#5

Here after i compile with your code

Код:
SA-MP Dedicated Server
----------------------
v0.3.7, ©2005-2015 SA-MP Team

[14:44:51] filterscripts = ""  (string)
[14:44:51] 
[14:44:51] Server Plugins
[14:44:51] --------------
[14:44:51]  Loading plugin: sscanf
[14:44:51] 

[14:44:51]  ===============================

[14:44:51]       sscanf plugin loaded.     

[14:44:51]    © 2009 Alex "******" Cole

[14:44:51]    0.3d-R2 500 Players "dnee"

[14:44:51]  ===============================

[14:44:51]   Loaded.
[14:44:51]  Loading plugin: streamer
[14:44:51] 

*** Streamer Plugin v2.7.6 by Incognito loaded ***

[14:44:51]   Loaded.
[14:44:51]  Loading plugin: Whirlpool
[14:44:51]  
[14:44:51]  ==================
[14:44:51]  
[14:44:51]   Whirlpool loaded
[14:44:51]  
[14:44:51]  ==================
[14:44:51]  
[14:44:51]   Loaded.
[14:44:51]  Loading plugin: MapAndreas
[14:44:51]   Loaded.
[14:44:51]  Loading plugin: iTD
[14:44:51] 
* iTD Plugin loaded. (Support for textdraw editor mouse/keyboard)

[14:44:51]   Loaded.
[14:44:51]  Loading plugin: mysql
[14:44:51] 

  > MySQL plugin R5 successfully loaded.

[14:44:51]   Loaded.
[14:44:51]  Loading plugin: getaks
[14:44:51]   Loaded.
[14:44:51]  Loaded 7 plugins.

[14:44:51] 
[14:44:51] Filterscripts
[14:44:51] ---------------
[14:44:51]   Loaded 0 filterscripts.


----------------------------------
[14:44:51]  COD TEST
[14:44:51] ----------------------------------

[14:44:51] Number of vehicle models: 28
Reply
#6

Yes. But you have to do that in game. You start the server with the new code and then you leave the zone.
What is printing then?

- Mencent
Reply
#7

aahh haha ok
Reply
#8

[15:01:00] [join] Player has joined the server (0:127.0.0.1)
[15:01:55] checkpointid: 3 - CP[0] = 1
[15:01:55] checkpointid: 3 - CP[1] = 2
[15:01:55] checkpointid: 3 - CP[2] = 3
[15:01:55] Captured[2] == 0
[15:01:55] checkpointid: 3 - CP[3] = 4
[15:01:55] checkpointid: 3 - CP[4] = 5
[15:01:55] checkpointid: 3 - CP[5] = 6
[15:01:55] checkpointid: 3 - CP[6] = 7
[15:01:55] checkpointid: 3 - CP[7] = 8
[15:01:55] checkpointid: 3 - CP[8] = 9
[15:01:55] checkpointid: 3 - CP[9] = 0
[15:01:55] checkpointid: 3 - CP[10] = 0
[15:01:55] checkpointid: 3 - CP[11] = 0
[15:01:55] checkpointid: 3 - CP[12] = 0
[15:01:55] checkpointid: 3 - CP[13] = 0
[15:01:55] checkpointid: 3 - CP[14] = 0
[15:01:55] checkpointid: 3 - CP[15] = 0
[15:01:55] checkpointid: 3 - CP[16] = 0
[15:01:55] checkpointid: 3 - CP[17] = 0
[15:01:55] checkpointid: 3 - CP[18] = 0
[15:01:55] checkpointid: 3 - CP[19] = 0
[15:01:55] checkpointid: 3 - CP[20] = 0
[15:01:55] checkpointid: 3 - CP[21] = 0
[15:01:55] checkpointid: 3 - CP[22] = 0
[15:01:55] checkpointid: 3 - CP[23] = 0
[15:01:55] checkpointid: 3 - CP[24] = 0
[15:01:55] checkpointid: 3 - CP[25] = 0
[15:01:55] checkpointid: 3 - CP[26] = 0
[15:01:55] checkpointid: 3 - CP[27] = 0
[15:01:55] checkpointid: 3 - CP[28] = 0
[15:01:55] checkpointid: 3 - CP[29] = 0
[15:02:19] [part] Player has left the server (0:1)
Reply
#9

Where are you set Captured[x] to 1?


- Mencent
Reply
#10

im on the capture zone middle ?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)