SA:MP Project: KowaZ Zone Include [KZI]
#1

SA:MP Project

KowaZ Zone Include [KZI]
- Newest Version: v1.0 -

KZI.inc:

Destription:

This file contains the functions for the gangs and for the zones. You can find altogether 48 functions (including the macros) and some #define constants. You just need to pu the KZI.inc in your pawno/include folder and write in your script the following line: #include <KI>. The functions will be listed on the right column (id you're using Pawno).

I'm using bitwise operators for more memory spaces. You have a limit, that you're not recommend to change: the MAX_ZONES and the MAX_GANGS. You shouldn't change them.

Be careful, because the functions doesn't check the validity of the given IDs, so you should check it with calling the Zone_isActive() or Gang_IsActive() functions.


Callbacks:

OnPlayerEnterZone(playerid, zoneid)
Called when a player entered in a zone.

OnPlayerLeaveZone(playerid, zoneid)
Called when a player left in a zone.


Core functions:

KZI_Init();
Paste this in the entry point of your script.

KZI_OnPlayerSpawn(playerid);
Paste this in the OnPlayerSpawn.

KZI_OnPlayeDisconnect(playerid);
Paste this in the OnPlayeDisconnect.

KZI_Loop();
Call this function in every ZONE_LOOP_FREQUENCY ms.


kzi-handler.pwn:

Destription:

With this filterscript you can create, modify zones with ease. The are only 2 commands: /azone and /kzi-colors. This version doesn't save zones or load them from file or database.

Commands:

These commands are restricted to RCON admins.

/azone create [name]
Creates a new zone.

/azone destroy [zoneid]
Deletes a zone.

/azone visible [zoneid]
Toggle the zone visible/invisible.

/azone gang [zoneid] [gangid]
Sets the zone's gang.

/azone flash [zoneid]
Sets the zone flashing or not.

/azone lock [zoneid]
Locks the zone.

/azone unlock [zoneid]
Unlocks the zone.

/azone minx [zoneid] [value]
Sets the MinX coordinate.

/azone miny [zoneid] [value]
Sets the MinY coordinate.

/azone maxx [zoneid] [value]
Sets the MaxX coordinate.

/azone maxy [zoneid] [value]
Sets the MaxY coordinate.


gangwar.pwn:

Destription:

This is an example gamemode based on the KZI system. No vehicles included, just 2 teams and 4 zones. The teams can capture the enemy zones with killing enemy gangmembers on their zone. After 20 kills, a gangwar will start. The first team who kills an enemy 20 times, win the war.

I know this is not the best gangwar-system. I saw a better gangwar-system in ******'s YSI project, so I'll request a permission to use his time-related gangwar-system.

Downloads
- v0.2.1 - v1.0 -

v1.0
SA:MP Project: KowaZ Zone Include v1.0 RECOMMENDED

v0.2
KowaZ Zone System v0.2.1
KowaZ Zone System v0.2.2
KowaZ Zone System v0.2.3

v0.3
KowaZ Zone System v0.3.1
KowaZ Zone System v0.3.2

v0.4
KowaZ Zone System v0.4.1

v0.5
The KowaZ Project v0.5.1
The KowaZ Project v0.5.2



Ковалски
Reply
#2

Great... one little thing could u do K_Command ??
Reply
#3

Quote:
Originally Posted by cmg4life
Great... one little thing could u do K_Command ??
You can rewrote the functions, if you want. KowaZ tags are for solving problems with existing functions.
If you want, I can write them all to K_ (or I'll release a K_ version. lol)
Reply
#4

Code:
When j try to complite the pawn j heve errors :/ 
(77) : error 017: undefined symbol "strtok"
(77) : error 033: array must be indexed (variable "cmd")
(85) : error 017: undefined symbol "strtok"
(85) : error 033: array must be indexed (variable "tmp")
(129) : error 017: undefined symbol "strtok"
(129) : error 033: array must be indexed (variable "tmp")
(150) : error 017: undefined symbol "strtok"
(150) : error 033: array must be indexed (variable "tmp")
(171) : error 017: undefined symbol "strtok"
(171) : error 033: array must be indexed (variable "tmp")
(192) : error 017: undefined symbol "strtok"
(192) : error 033: array must be indexed (variable "tmp")
(199) : error 017: undefined symbol "strtok"
(199) : error 033: array must be indexed (variable "tmp")
(219) : error 017: undefined symbol "strtok"
(219) : error 033: array must be indexed (variable "tmp")
(226) : error 017: undefined symbol "strtok"
(226) : error 033: array must be indexed (variable "tmp")
(246) : error 017: undefined symbol "strtok"
(246) : error 033: array must be indexed (variable "tmp")
(253) : error 017: undefined symbol "strtok"
(253) : error 033: array must be indexed (variable "tmp")
(273) : error 017: undefined symbol "strtok"
(273) : error 033: array must be indexed (variable "tmp")
(280) : error 017: undefined symbol "strtok"
(280) : error 033: array must be indexed (variable "tmp")
Reply
#5

Code:
new tmp[256];
Code:
tmp = strtok(cmdtext,idx);
Code:
strtok(const string[], &index)
{
	new length = strlen(string);
	while ((index < length) && (string[index] <= ' '))
	{
		index++;
	}

	new offset = index;
	new result[20];
	while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
	{
		result[index - offset] = string[index];
		index++;
	}
	result[index - offset] = EOS;
	return result;
}
Reply
#6

Update

kowaz_zones.h

All KowaZ_ tags replaced with K_.

New functions added:

K_GetZoneCount();
Returns the amount of the zones (not the gang zones count!).

K_SaveZonesInFile(filename[]);
Saves the zones in a specified file.

K_LoadZonesFromFile(filename[]);
Loads the zones from a specified file.

This saving system saves the color, the name and the position.
If the file doesn't exist, the script won't create it, so you need to create the file by yourself.


Download:

Download link of:
- kowaz_zones.h
- kowzonehand022.pwn
- kowzonehand022.amx

KowaZ Zone System v0.2.2


Kowalski
Reply
#7

Still Doesnt woks for me

Same error that have Maniek
Reply
#8

Update

kowaz_zones.h

Fixed K_SetZonePos() bug.

Download:

Download link of:
- kowaz_zones.h
- kowzonehand023.pwn
- kowzonehand023.amx

KowaZ Zone System v0.2.3


Quote:
Originally Posted by Chumillas
Doesnt woks for me
1.) Download the newest version.
2.) Where is that problem? In the INC or in the FS?


Kowalski
Reply
#9

thank you
i will try it as soon as i can get my GTA:SA working again
Reply
#10

Quote:
Originally Posted by jesse989898
thank you
i will try it as soon as i can get my GTA:SA working again
Okay.
And check the kowaz_zones.h.
When the script saves the zones, converts the Hex to RGBA. On load, coverts it back. That was what I taked about.

I almost forgot. Credits to:
- [NB]mabako (rgba2int and int2rgba functions)
- Denver (strsplit function)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)