Create GANG
#1

I have a problem from these script, they show me warling and I can not solve it ... would someone help me


PHP Code:
#include a_samp
#define MAX_GANGS 23
new Float:ZonaVeci[MAX_GANGS][11];
new 
ZonaPridaj 0;
new 
praca[MAX_PLAYERS]; //Job
new Vyplaty[MAX_PLAYERS];
new 
ZonaFarba[5] = {0x40FF00FF0xB700FFFF0x715E72FF};
new 
ZonaFunkce;
public 
OnPlayerConnect(playerid)
{
    for(new 
axa 0axa MAX_GANGSaxa++)
    {
        
GangZoneShowForPlayer(playeridZonaVeci[axa][7], ZonaVeci[axa][4]);
    }
    
AddZona(00111111110xF814141);
    return 
1;
}
public 
OnPlayerDisconnect(playerid,reason)
{
    for(new 
xcxc 0xcxc MAX_GANGSxcxc++)
    {
        
GangZoneHideForPlayer(playeridZonaVeci[xcxc][7]);
    }
}
stock ZbytocnaFunkcia(playeridFloat:XaXFloat:YaYFloat:ZaZFloat:AaA)
{
    new 
Float:0.0Float:0.0Float:0.0;
    
GetPlayerPos(playeridXYZ);
    if(
XaX && YaY && ZaZ && AaA)
    {
        return 
1;
    }
    return 
0;
}
stock Funkce()
{
    return 
0;
}
public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
IsPlayerConnected(playerid))
    {
        if(
newkeys == || newkeys == 132)
        {
            if(
praca[playerid] == || praca[playerid] == || praca[playerid] == || praca[playerid] == 4)
            {
                if(!
IsPlayerInAnyVehicle(playerid))
                {
                    if(
GetPlayerWeapon(playerid))
                    {
                        new 
varujemta 0;
                        while(++
varujemta MAX_GANGS)
                        {
                            if(
ZbytocnaFunkcia(playeridZonaVeci[varujemta][0], ZonaVeci[varujemta][2], ZonaVeci[varujemta][1], ZonaVeci[varujemta][3]))
                            {
                                
ZonaVeci[varujemta][5]++;
                                if(
ZonaVeci[varujemta][5] < 3)
                                {
                                    return 
0;
                                }
                                
ZonaVeci[varujemta][5] = 0;
                                if(
ZonaVeci[varujemta][8])
                                {
                                    return 
0;
                                }
                                if(
ZonaVeci[varujemta][9] == praca[playerid])
                                {
                                    
SendClientMessage(playerid,-1"Niečo jebnutйho Teraz");
                                }
                                else if(
ZonaVeci[praca[playerid]][10])
                                {
                                    
SendClientMessage(playerid,-1"Niečo jebnutйho Potom");
                                }
                                else
                                {
                                    
GangZoneFlashForAll(ZonaVeci[varujemta][7], ZonaFarba[praca[playerid]]);
                                    
ZonaVeci[varujemta][6] = praca[playerid];
                                    
ZonaVeci[praca[playerid]][10] = 1;
                                    
ZonaVeci[ZonaVeci[varujemta][9]][10] = 1;
                                    
ZonaVeci[varujemta][8] = 1;
                                    
SetTimerEx("KonecBoje"60000false"i"varujemta);
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    return 
1;
}
        
forward KonecBoje(playerid);
public 
KonecBoje(playerid)
{
    new 
varujemta 0;
    for(new 
xcxc 0xcxc MAX_GANGSxcxc++)
    {
        if(
IsPlayerConnected(xcxc))
        {
            
Funkce();
            if(
praca[xcxc] == || praca[xcxc] == || praca[xcxc] == || praca[xcxc] == 4)
            {
                
Funkce();
                if(
praca[xcxc] == ZonaVeci[playerid][6])
                {
                    
ZonaVeci[praca[xcxc]][10] = 0;
                    
Funkce();
                    if(
ZbytocnaFunkcia(xcxcZonaVeci[playerid][0], ZonaVeci[playerid][2], ZonaVeci[playerid][1], ZonaVeci[playerid][3]))
                    {
                        
varujemta++;
                        if(
varujemta)
                        {
                            
Funkce();
                            
ZonaVeci[ZonaVeci[playerid][6]][10] = 0;
                            
ZonaVeci[ZonaVeci[playerid][9]][10] = 0;
                            
ZonaVeci[playerid][8] = 0;
                            
GangZoneStopFlashForAll(ZonaVeci[playerid][7]);
                            
GangZoneHideForAll(ZonaVeci[playerid][7]);
                            
GangZoneShowForAll(ZonaVeci[playerid][7], ZonaFarba[praca[xcxc]]);
                            
ZonaVeci[playerid][4] = ZonaFarba[praca[xcxc]];
                            
ZonaVeci[playerid][9] = praca[xcxc];
                            
ZonaVeci[playerid][6] = 0;
                            new 
var2[128];
                            
Vyplaty[xcxc]++;
                            
Vyplaty[xcxc] = Vyplaty[xcxc];
                            
format(var2128"~r~odmena~n~~w~%d$"46488);
                            
GameTextForPlayer(xcxcvar240004);
                            
ZonaFunkce ZonaFunkce ZonaFunkce;
                        }
                    }
                }
            }
        }
    }
    if(!
varujemta)
    {
        
Funkce();
        
ZonaVeci[playerid][8] = 0;
        
ZonaVeci[ZonaVeci[playerid][6]][10] = 0;
        
ZonaVeci[ZonaVeci[playerid][9]][10] = 0;
        
GangZoneStopFlashForAll(ZonaVeci[playerid][7]);
    }
    return 
1;
}
forward Float:AddZona(Float:minXFloat:minYFloat:maXXFloat:maXYcolorID);
public 
Float:AddZona(Float:minXFloat:minYFloat:maXXFloat:maXYcolorID)
{
    if(
ZonaPridaj <= MAX_GANGS)
    {
        
ZonaVeci[ZonaPridaj][7] = GangZoneCreate(minXminYmaXXmaXY);
        
ZonaVeci[ZonaPridaj][0] = minX;
        
ZonaVeci[ZonaPridaj][1] = minY;
        
ZonaVeci[ZonaPridaj][2] = maXX;
        
ZonaVeci[ZonaPridaj][3] = maXY;
        
ZonaVeci[ZonaPridaj][4] = color;
        
ZonaVeci[ZonaPridaj][9] = ID;
        
ZonaVeci[ZonaPridaj][8] = 0;
        
ZonaPridaj++;
    }
    else
    {
        
printf("Kapacita gang zon byla prekrocena gang zona nebyla vytvorena");
    }
    return 
1;

Reply
#2

Help me
Reply
#3

What warning/error does it show from your side?
Reply
#4

At the moment I'm not on PC but when you copy it so I'll show you the errors....
Reply
#5

What kinda warning you show?
Reply
#6

Use enums to reorganize the data structure in the ZonaVeci array.

https://forums.alliedmods.net/showthread.php?t=140103

And put AddZona before OnPlayerConnect.
Reply
#7

ok ok

forward Float:AddZona(Float:minX, Float:minY, Float:maXX, Float:maXY, color, ID);
public Float:AddZona(Float:minX, Float:minY, Float:maXX, Float:maXY, color, ID)
{
if(ZonaPridaj <= MAX_GANGS)
{
ZonaVeci[ZonaPridaj][7] = GangZoneCreate(minX, minY, maXX, maXY);
ZonaVeci[ZonaPridaj][0] = minX;
ZonaVeci[ZonaPridaj][1] = minY;
ZonaVeci[ZonaPridaj][2] = maXX;
ZonaVeci[ZonaPridaj][3] = maXY;
ZonaVeci[ZonaPridaj][4] = color;
ZonaVeci[ZonaPridaj][9] = ID;
ZonaVeci[ZonaPridaj][8] = 0;
ZonaPridaj++;
}
else
{
printf("Kapacita gang zon byla prekrocena gang zona nebyla vytvorena");
}
return 1;
}

Warling: return 1; warning 213: tag mismatch
Reply
#8

Told you. Use enum in ZonaVeci array to separate the integers from the floats. Like this.

PHP Code:

#define MAX_GANGS 23 
enum _:eZonaVeci {
    
Float:ZONAVECI_MIN_X// 0
    
Float:ZONAVECI_MIN_Y// 1
    
Float:ZONAVECI_MAX_X// 2
    
Float:ZONAVECI_MAX_Y// 3
    
ZONAVECI_COLOR// 4
    
ZONAVECI_DATA_5// 5
    
ZONAVECI_DATA_6// 6
    
ZONAVECI_GANG_ZONE// 7
    
ZONAVECI_DATA_8,
    
ZONAVECI_DATA_9,
    
ZONAVECI_DATA_10,
    
ZONAVECI_DATA_11
}
new 
ZonaVeci[MAX_GANGS][eZonaVeci];
forward Float:AddZona(Float:minXFloat:minYFloat:maXXFloat:maXYcolorID); 
public 
Float:AddZona(Float:minXFloat:minYFloat:maXXFloat:maXYcolorID

    if(
ZonaPridaj <= MAX_GANGS
    { 
        
ZonaVeci[ZonaPridaj][ZONAVECI_GANG_ZONE] = GangZoneCreate(minXminYmaXXmaXY); 
        
ZonaVeci[ZonaPridaj][ZONAVECI_MIN_X] = minX
        
ZonaVeci[ZonaPridaj][ZONAVECI_MIN_Y] = minY
        
ZonaVeci[ZonaPridaj][ZONAVECI_MAX_X] = maXX
        
ZonaVeci[ZonaPridaj][ZONAVECI_MAX_Y] = maXY
        
ZonaVeci[ZonaPridaj][ZONAVECI_COLOR] = color
        
ZonaVeci[ZonaPridaj][ZONAVECI_DATA_9] = ID
        
ZonaVeci[ZonaPridaj][ZONAVECI_DATA_8] = 0
        
ZonaPridaj++; 
    } 
    else 
    { 
        
printf("Kapacita gang zon byla prekrocena gang zona nebyla vytvorena"); 
    } 
    return 
1

By putting "Float:" before "AddZone" you declare that the return value should be a Float, and your are returning an integer.

So you need to remove the Float:

PHP Code:
forward AddZona(Float:minXFloat:minYFloat:maXXFloat:maXYcolorID);  
public 
AddZona(Float:minXFloat:minYFloat:maXXFloat:maXYcolorID)  
{  
    
// ...
    
return 1;  

Or modify the return value:

PHP Code:
forward Float:AddZona(Float:minXFloat:minYFloat:maXXFloat:maXYcolorID);  
public 
Float:AddZona(Float:minXFloat:minYFloat:maXXFloat:maXYcolorID)  
{  
    
// ...
    
return 1.0;  

Reply
#9

ok ok
But by creating a zone Web I created zones and showed me the servers this:


Code? and does not want to change the zone when I fight for it, for example
Reply
#10

help boys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)