SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 07/03/2019, 05:31 PM   #1
EmpireSk
Huge Clucker
 
EmpireSk's Avatar
 
Join Date: Jul 2013
Location: Slovakia
Posts: 356
Reputation: 10
Default Create GANG

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;

__________________
EmpireSk is offline   Reply With Quote
Old 08/03/2019, 12:50 AM   #2
EmpireSk
Huge Clucker
 
EmpireSk's Avatar
 
Join Date: Jul 2013
Location: Slovakia
Posts: 356
Reputation: 10
Default Re: Create GANG

Help me
__________________
EmpireSk is offline   Reply With Quote
Old 08/03/2019, 05:25 AM   #3
ComDuck
Big Clucker
 
ComDuck's Avatar
 
Join Date: Feb 2019
Posts: 82
Reputation: 12
Default Re: Create GANG

What warning/error does it show from your side?
ComDuck is offline   Reply With Quote
Old 08/03/2019, 06:01 AM   #4
EmpireSk
Huge Clucker
 
EmpireSk's Avatar
 
Join Date: Jul 2013
Location: Slovakia
Posts: 356
Reputation: 10
Default Re: Create GANG

At the moment I'm not on PC but when you copy it so I'll show you the errors.... ��
__________________
EmpireSk is offline   Reply With Quote
Old 08/03/2019, 08:43 AM   #5
alishan
Banned
 
Join Date: Mar 2019
Location: Pakistan
Posts: 5
Reputation: 3
Default Re: Create GANG

What kinda warning you show?
alishan is offline   Reply With Quote
Old 08/03/2019, 10:27 AM   #6
Autorojo
Little Clucker
 
Join Date: Mar 2015
Posts: 17
Reputation: 0
Default Re: Create GANG

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

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

And put AddZona before OnPlayerConnect.
Autorojo is offline   Reply With Quote
Old 08/03/2019, 11:03 AM   #7
EmpireSk
Huge Clucker
 
EmpireSk's Avatar
 
Join Date: Jul 2013
Location: Slovakia
Posts: 356
Reputation: 10
Default Re: Create GANG

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
__________________
EmpireSk is offline   Reply With Quote
Old 08/03/2019, 12:21 PM   #8
Autorojo
Little Clucker
 
Join Date: Mar 2015
Posts: 17
Reputation: 0
Default Re: Create GANG

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;  

Autorojo is offline   Reply With Quote
Old 10/03/2019, 05:51 PM   #9
EmpireSk
Huge Clucker
 
EmpireSk's Avatar
 
Join Date: Jul 2013
Location: Slovakia
Posts: 356
Reputation: 10
Default Re: Create GANG

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
__________________
EmpireSk is offline   Reply With Quote
Old 10/03/2019, 06:57 PM   #10
EmpireSk
Huge Clucker
 
EmpireSk's Avatar
 
Join Date: Jul 2013
Location: Slovakia
Posts: 356
Reputation: 10
Default Re: Create GANG

help boys
__________________
EmpireSk is offline   Reply With Quote
Reply

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 Create Help CurlyPwn Scripting Help 0 07/05/2013 10:06 AM
Gang Create CurlyPwn Scripting Help 7 06/05/2013 03:17 PM
How to create in game gang? StefanKremenovic Scripting Help 0 26/08/2012 04:28 PM
Create Gang arachimi Help Archive 0 19/12/2009 10:47 PM
How to create a gang!? Parkour Help Archive 2 05/06/2009 04:18 PM


All times are GMT. The time now is 01:45 AM.


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