[GameMode] ZBSS - ZB-SA:MP gamemode (Deathmatch, Free Roam, Mini Game)
#1

ZB-SA:MP Event gamemode






Important information on script:

Script was written for the ZB-SA:MP community and it worked with MySQL database of ZB SMF forum. You'll need a XAMPP package in order to set up and run this script on your own computer. Search for the tutorial how to successfully install this package on your computer. You'll also need SMF 2.0.x version of package which you'll install on your computer once the XAMPP package is successfully installed.
Once the SMF package is successfully installed on your computer, use the phpMyAdmin feature to add these keys to the SMF MySQL database:
  • inGame_Ban in table PREFIX_members, Type: int(7), Default: 0
  • inGame_Score in table PREFIX_members, Type: int(7), Default: 0
"PREFIX" is the one you set while installing the SMF package, it's "smf" as default.

Since the script is adjusted for the ZB forum, it uses the IDs of ZB forum groups. Group "Administrator" has an ID 1, "Super Moderator" has an ID 2, "Co-Administrator" has an ID 16, "Webmaster" has an ID 20 and the group for the competitors has an ID 21. All these groups (except the group for competitors) have the power to use the administrative commands on the server while the group for competitors only has a right to connect to the server.
You can manage the forum groups on the SMF forum in the Administrator page. Group "Administrator" has the default ID 1, as for the other groups, you should check them. Create the group for the competitors and change the ID of the group which is defined in the script.

These are the definitions of ZB forum group IDs:
GROUP_ADMIN = 1
GROUP_SUPERMOD = 2
GROUP_COADMIN = 16
GROUP_WEBMASTER = 20
GROUP_COMPETITION = 21

You can also delete the code in the script which is checking if the player is added in the competitors group. As for the power groups, you should leave at least the group for Administrators, so you can manage the script.

The screenshots/pictures you're going to see in this topic are from the server while using the Croatian language, but don't worry, English language was added also, and you can read more about multi-language system below. Read the description to get the whole point if you don't understand the Croatian (from screenshots/pictures).




Registration system, connection to server and names:

The script is connected with the database of forum, registration through the server is disabled. Use your username (and not display name) and password from the forum in order to login on the server and be able to play. Only users/players who are added to the forum competition group will have access to the server (if you didn't delete the code which I mentioned before). If you have a ban on the forum, then you won't be able to connect to the server.

SA-MP doesn't support "weird" names like SMF forum does. Make sure you have a normal name (example: Correlli), because if you have a wrong name like "Don Locatelli" for example, server will cut out the "Locatelli" and change the name to "Don" which is wrong. If you have oddly characters in your name, like "Correlli%" for example, server won't let you pass.

http://imageshack.us/a/img829/6217/unacpncqnm.png

If you enter a wrong password for three times, then you'll be kicked from the server. Make sure to know your password from the forum before you connect to the server.

You'll be able to see the username and display name for every player. Username is the name which is used to login to the forum and connect to the server (example: mafica), while the display name is the name which is displayed to all other users (example: mafica .pwn). If you didn't change your display name, then it should be the same as username.

Name of the Administrators is displayed in the red color, while the ordinary players have a name displayed in the white color.

http://imageshack.us/a/img43/6121/17788742.png
http://imageshack.us/a/img687/8950/22781752.png
http://imageshack.us/a/img191/7159/91760871.png




Guard/protection on the server:
  • Protection against money cheat.
  • Protection against health and armor cheat.
  • Protection against vehicle health cheat.
  • Protection against weapon and ammo cheat.
  • Protection against speed and teleport cheat.
  • Protection against jetpack cheat.
  • Protection against vehicle modification cheat, access to the modification garages is disabled.
  • Protection against drive-by kills.
  • Protection against fake kills.
  • Protection against bunny jumping.
  • Protection against text and command spam.
  • Protection against big ping.
  • Protection against IP/URL advertisements.
  • Protection against writing only in capital letters.
  • Protection against pausing in events.
  • Protection against bot connection flood.



Guard/protection settings:

List of settings:
  • Event score counting
  • Money cheat
  • Health/armor cheat
  • Vehicle health cheat
  • Weapon/ammo cheat
  • Vehicle speed cheat
  • Player speed/teleport cheat
  • Jetpack cheat
  • Vehicle modification cheat
  • Drive-by detection
  • Fake kill detection
  • Bunny-jump/hop detection
  • Text/command spam detection
  • Ping limit
  • RCON logging
  • IP/URL advertisement
  • Capital letters
  • In-event pause detection
Use the "/guard" command in order to open a window with guard/protection settings. You can turn on/off the guard/protection settings and some other settings like score counting and pause detection in events.

Settings "Event score counting" and "Capital letters" are turned off by default when the server starts.

http://imageshack.us/a/img39/5632/32301960.png
http://imageshack.us/a/img69/6218/40133641.png




Multi-language:
You can choose two languages on the server: English and Croatian (radical and phonemic orthography). Use the "/setlang" command to change the language. If you wish to add more languages, then read this topic.




Existing events in the script:

IDNameNumber of winner scoreLimit of players
1Glass above Water 16from 2 to "MAX_PLAYERS" players
2Glass above Water 28from 2 to "MAX_PLAYERS" players
3Shootout on Hay 13from 2 to "MAX_PLAYERS" players
4Shootout on Hay 25from 2 to "MAX_PLAYERS" players
5Shootout on Hay 34from 2 to "MAX_PLAYERS" players
6Shootout on Glass5from 2 to "MAX_PLAYERS" players
7Shootout on Sky7from 2 to "MAX_PLAYERS" players
8Grand Theft Race8from 2 to 12 players, because there are 12 vehicles in this event
9To Heaven and Back6from 2 to 18 players, because there are 18 vehicles in this event
10Mount Chiliad 18from 2 to 12 players, because there are 12 vehicles in this event
11Mount Chiliad 29from 2 to 12 players, because there are 12 vehicles in this event
12Underwater Race7from 2 to 18 players, because there are 18 vehicles in this event
13Race on Sky12from 2 to 15 players, because there are 15 vehicles in this event
14Go-kart Race8from 2 to 15 players, because there are 15 vehicles in this event
15RC-pot Race10from 2 to 20 players, because there are 20 vehicles in this event
16Circle Race9from 2 to 20 players, because there are 20 vehicles in this event
17Triathlon8from 2 to 18 players, because there are 18 vehicles in this event
18Easy Skydiving12from 2 to "MAX_PLAYERS" players
19Medium Skydiving14from 2 to "MAX_PLAYERS" players
20Long Skydiving16from 2 to "MAX_PLAYERS" players
21Last Monster standing 17from 2 to 8 players, because there are 8 vehicles in this event
22Last Monster standing 29from 2 to 20 players, because there are 20 vehicles in this event
23Chainsaw Massacre5from 2 to "MAX_PLAYERS" players
24Santa Maria Beach Shootout4from 2 to "MAX_PLAYERS" players
25Glass above Water 39from 2 to "MAX_PLAYERS" players
26Shootout on Moving Hay9from 2 to "MAX_PLAYERS" players
27Shootout on Jetdoor7from 2 to "MAX_PLAYERS" players
The player will also be the winner of event if all other competitors abort their playing in the event (usage of "/leave" command), leave the server, or if they get kicked from the event because they were pausing. Pausing is forbidden in the events (Administrators are exception), and if you pause in the event, the script will kick you from the event. If you take screenshots with F8 button while in the event, the script will take that for pausing also.

For every event won, the player will get a certain amount of winner points (you can see the winner points for each event on the list of default events above).
Don't worry if your game freezes, your winner points will wait for you, because they're stored in the database. Use the TAB button to check your winner points and winner points of other players.

You can also see the top 5 players on the screen.

http://imageshack.us/a/img194/2351/19911864.png
http://imageshack.us/a/img18/9025/60575484.png

http://imageshack.us/a/img9/3706/92604202.png
http://imageshack.us/a/img96/2503/98545461.png
http://imageshack.us/a/img521/9906/72377883.png
http://imageshack.us/a/img825/8581/21108282.png
http://imageshack.us/a/img716/400/55291249.png
http://imageshack.us/a/img694/6497/22881109.png
http://imageshack.us/a/img202/8406/52012503.png
http://imageshack.us/a/img28/4305/38081741.png
http://imageshack.us/a/img607/7407/50091315.png
http://imageshack.us/a/img843/4118/15255347.png
http://imageshack.us/a/img33/9210/87391464.png
http://imageshack.us/a/img90/5898/37168655.png
http://imageshack.us/a/img825/2073/58531335.png
http://imageshack.us/a/img585/5613/86928411.png
http://imageshack.us/a/img189/5769/20977024.png
http://imageshack.us/a/img90/7864/91328599.png
http://imageshack.us/a/img194/2681/25261251.png
http://imageshack.us/a/img819/9835/79679171.png

/imageshack/img138/6052/67942281.png
/imageshack/img705/4590/52766246.png
/imageshack/img19/7041/86272619.png
/imageshack/img19/221/35818321.png
/imageshack/img132/5481/23629112.png

/imageshack/img600/3976/63057846.png
/imageshack/img6/8092/41612726.png
/imageshack/img834/1019/58369259.png
/imageshack/img825/6154/74812446.png

/imageshack/img401/6061/46515415.png
/imageshack/img191/9556/10097826.png
/imageshack/img27/2536/63360622.png
/imageshack/img138/9555/53792020.png
/imageshack/img707/592/38660454.png

/imageshack/img547/9198/76140802.png
/imageshack/img5/3157/74837501.png
/imageshack/img823/7673/99092501.png
/imageshack/img839/9821/16145267.png
/imageshack/img855/7161/62417808.png
/imageshack/img826/6282/25770264.png
/imageshack/img823/6085/58903751.png
/imageshack/img580/6006/82458601.png
/imageshack/img132/267/17097051.png

/imageshack/img829/2802/35269516.png
/imageshack/img571/8217/51011340.png
/imageshack/img69/8140/86015365.png
/imageshack/img856/6708/18671039.png
/imageshack/img845/8441/20405202.png
/imageshack/img20/9868/70604623.png
/imageshack/img594/4205/52016044.png
/imageshack/img221/392/76222186.png

/imageshack/img707/34/91665392.png
/imageshack/img593/7530/80989438.png
/imageshack/img600/2274/92083058.png
/imageshack/img4/7595/61250569.png

http://imageshack.us/a/img705/2240/32700401.png
http://imageshack.us/a/img818/6654/58548109.png
http://imageshack.us/a/img835/4375/54270229.png
http://imageshack.us/a/img856/5112/circleevent.png




Some functions and creation of your own events:

The script will register the event as created if you create at least one object for event using the "CreateEventObject" function or if you create at least one vehicle for event using the "CreateEventVehicle" function. The script will recognize the event as correctly created if you set all other settings (type of event, required number of players). When you destroy/delete the last object and vehicle from the script, the event will be automatically deleted from the script and it won't exist anymore. Even one created vehicle or one created object is enough for the script to count the event as created.


CreateEventObject
With this function you can create an object for the specific event
@eventid = Event ID.
@modelid = Model ID of object.
@Float: x_pos = X position of object.
@Float: y_pos = Y position of object.
@Float: z_pos = Z position of object.
@Float: x_rot = X rotation of object.
@Float: y_rot = Y rotation of object.
@Float: z_rot = Z rotation of object.
@Float: distance = Distance on which the object will be streamed for the player.
returns - number of all created objects for this event.
Example:
pawn Код:
CreateEventObject(5, 4241, 10.0, 10.0, 10.0, 0.0, 90.0, 270.0, 100.0);
DestroyEventObject
With this function you can delete the created object of the specific event
@eventid = Event ID.
@slotid = Slot ID on which the object and its information are.
returns - value true if event exists in the script or false if event doesn't exist.
Example:
pawn Код:
// This code will delete all created objects for the event with ID 5.
// Slot ID is the number which is increasing automatically with the creation of objects, it starts with 0 and ends with one number smaller than the one which is defined as "MAX_EVENT_OBJECTS".
for(new a = 0; a < MAX_EVENT_OBJECTS; a++)
    DestroyEventObject(5, a);
CreateEventVehicle
With this function you can create a vehicle for the specific event
@eventid = Event ID.
@modelid = Model ID of vehicle.
@Float: x_pos = X position of vehicle.
@Float: y_pos = Y position of vehicle.
@Float: z_pos = Z position of vehicle.
@Float: angle = Rotation of vehicle.
@Float: respawn_delay = Amount of time in which the vehicle will respawn.
returns - number of all created vehicles for this event.
Example:
pawn Код:
CreateEventVehicle(5, 522, 25.0, 15.0, 10.0, 180.0, 240);
DestroyEventVehicle
With this function you can delete the created vehicle of the specific event
@eventid = Event ID.
@slotid = Slot ID on which the vehicle and its information are.
returns - value true if event exists in the script or false if event doesn't exist.
Example:
pawn Код:
// This code will delete all created vehicles for the event with ID 5.
// Slot ID is the number which is increasing automatically with the creation of vehicles, it starts with 0 and ends with one number smaller than the one which is defined as "MAX_EVENT_VEHICLES".
for(new a = 0; a < MAX_EVENT_VEHICLES; a++)
    DestroyEventVehicle(5, a);
DestroyEvent
With this function you can delete the specific event from the script
@eventid = Event ID.
returns - value true if event exists in the script or false if event doesn't exist.
Example:
pawn Код:
DestroyEvent(5);
SetEventName
With this function you can set the name of the specific event
@eventid = Event ID.
@string[] = Event name.
returns - value true if event exists in the script or false if event doesn't exist.
Example:
pawn Код:
SetEventName(5, "My Event");
SetEventType
With this function you can set the type of the specific event
@eventid = Event ID.
@type = Event type.
returns - value true if event exists in the script or false if event doesn't exist or if the event type is invalid.
Example:
pawn Код:
SetEventType(5, EVENT_TYPE_OBJECT_FALL);
Definitions for event types in the script:
pawn Код:
EVENT_TYPE_OBJECT_FALL = 1
EVENT_TYPE_OBJECT_SHOOTOUT = 2
EVENT_TYPE_OBJECT_MOVE_SHOOTOUT = 3
EVENT_TYPE_SHOOTOUT = 4
EVENT_TYPE_RACE = 5
EVENT_TYPE_SKYDIVE = 6
EVENT_TYPE_TRIATHLON = 7
EVENT_TYPE_VEHICLE_RAM = 8
SetEventRequiredPlayers
With this function you can set the number of required players for the specific event in order for event to start
@eventid = Event ID.
@reqplayers = Number of required players.
returns - value true if event exists in the script or false if event doesn't exist or if the number of required players is smaller than 2 or bigger than "MAX_PLAYERS".
Example:
pawn Код:
SetEventRequiredPlayers(5, 25);
SetEventHeightLimit
With this function you can set the limit of Z position (height) for the specific event, and if the player falls under this position, he'll get kicked from the event
@eventid = Event ID.
@Float: height = Z position (height limit).
returns - value true if event exists in the script or false if event doesn't exist or if the height limit is setted as 0.0 or less.
Example:
pawn Код:
SetEventHeightLimit(5, 100.0);
SetEventRaceCheckpoint
With this function you can create checkpoints for the specific event (race, triathlon)
@eventid = Event ID.
@Float: x_pos = X position of checkpoint.
@Float: y_pos = Y position of checkpoint.
@Float: z_pos = Z position of checkpoint.
returns - value true if event exists in the script or false if event doesn't exist.
Example:
pawn Код:
SetEventRaceCheckpoint(5, 10.0, 10.0, 5.0);
SetEventRaceCheckpoint(5, 20.0, 20.0, 5.0);
SetEventRaceCheckpoint(5, 30.0, 30.0, 5.0);
SetEventRaceCheckpoint(5, 40.0, 40.0, 5.0);
SetEventRaceCheckpoint(5, 50.0, 50.0, 5.0);
SetEventSkydiveFinish
With this function you can set the finish height for the specific skydiving event
@eventid = Event ID.
@Float: height = Z position (finish height).
returns - value true if event exists in the script or false if event doesn't exist or if the finish height is setted as 0.0 or less.
Example:
pawn Код:
SetEventSkydiveFinish(5, 7.5);
SetEventSpecialSpawn
With this function you can set the spawn place of players for the specific event (shootout, skydiving or triathlon)
@eventid = Event ID.
@Float: x_pos = X position of spawn.
@Float: y_pos = Y position of spawn.
@Float: z_pos = Z position of spawn.
returns - value true if event exists in the script or false if event doesn't exist.
Example:
pawn Код:
SetEventSpecialSpawn(5, 3000.0, 1000.0, 100.0);
SetEventWeapon
With this function you can set the weapons of players for the specific event
@eventid = Event ID.
@weaponid = Weapon ID.
@ammo = Amount of ammunition.
returns - value true if event exists in the script or false if event doesn't exist or if the weapon ID is smaller than 0, bigger than 46, equal as 40 or if the amount of ammunition is less or same as 0.
Example:
pawn Код:
SetEventWeapon(5, WEAPON_BRASSKNUCKLE, 1);
SetEventWeapon(5, WEAPON_DEAGLE, 100);
SetEventWeapon(5, WEAPON_SHOTGUN, 50);
SetEventWinScore
With this function you can set the number of winner points for the specific event
@eventid = Event ID.
@score = Number of winner points.
returns - value true if event exists in the script or false if event doesn't exist or if the number of winner points is smaller than 1 or bigger than 100.
Example:
pawn Код:
SetEventWinScore(5, 15);

You can study yourself the other event functions such as "IsEventCreated", "GetEventMaxObjects", "GetEventMaxVehicles", "GetEventName", "GetEventType", "GetEventRequiredPlayers", "SetEventOpen", "IsEventOpened", "SetEventActive", "IsEventActive", "GetEventHeightLimit", "GetEventRaceCheckpoint", "GetEventSkydiveFinish", "GetEventSpecialSpawn", "GetEventWinScore", "IsEventObjectCreated", "IsEventVehicleCreated", ...


Example for event type "endurance on objects":
pawn Код:
new
        eventid = 0, a, b;
for(a = 0; a < 7; a++)
{
    for(b = 0; b < 7; b++)
        CreateEventObject(eventid, 1649, 0.0 + (4.4 * a), 0.0 + (3.31 * b), 20.0, 270.0, 0.0, 0.0, 50.0);
}
SetEventName(eventid, "Glass above Water");
SetEventType(eventid, EVENT_TYPE_OBJECT_FALL);
SetEventRequiredPlayers(eventid, 8);
SetEventOpen(eventid, false);
SetEventActive(eventid, false);
SetEventHeightLimit(eventid, 2.0); // Only for events with falling type.
SetEventWinScore(eventid, 3);
Example for event type "shootout on objects":
pawn Код:
new
        eventid = 1, a, b;
for(a = 0; a < 15; a++)
{
    for(b = 0; b < 15; b++)
        CreateEventObject(eventid, 3374, 0.0 + (4.0 * a), 0.0 + (4.0 * b), 20.0, 0.0, 0.0, 0.0, 85.0);
}
SetEventName(eventid, "Shootout on Hay");
SetEventType(eventid, EVENT_TYPE_OBJECT_SHOOTOUT);
SetEventRequiredPlayers(eventid, 10);
SetEventOpen(eventid, false);
SetEventActive(eventid, false);
SetEventHeightLimit(eventid, 10.0); // Only for events with falling type.
SetEventWeapon(eventid, WEAPON_BRASSKNUCKLE, 1);
SetEventWeapon(eventid, WEAPON_DEAGLE, 50);
SetEventWeapon(eventid, WEAPON_SHOTGUN, 25);
SetEventWinScore(eventid, 7);
Example for event type "shootout on moving objects":
pawn Код:
new
        eventid = 2, a, b;
for(a = 0; a < 20; a++)
{
    for(b = 0; b < 20; b++)
        CreateEventObject(eventid, 3374, 6500.0 + (4.0 * a), -1000.0 + (4.0 * b), 500.0 - (0.1 * a * b) + float(random(11)), 0.0, 0.0, 0.0, 125.0);
}
SetEventName(eventid, "Shootout on Moving Hay");
SetEventType(eventid, EVENT_TYPE_OBJECT_MOVE_SHOOTOUT);
SetEventRequiredPlayers(eventid, 10);
SetEventOpen(eventid, false);
SetEventActive(eventid, false);
SetEventHeightLimit(eventid, 450.0); // Only for events with falling type.
SetEventWeapon(eventid, WEAPON_BRASSKNUCKLE, 1);
SetEventWeapon(eventid, WEAPON_GRENADE, 2);
SetEventWeapon(eventid, WEAPON_SAWEDOFF, 100);
SetEventWeapon(eventid, WEAPON_M4, 250);
SetEventWinScore(eventid, 9);
Example for event type "normal shootout":
pawn Код:
new
        eventid = 3;
// A simple hidden object, needed only for event to be created.
CreateEventObject(eventid, 988, 0.0, 0.0, -5.0, 0.0, 0.0, 0.0, 80.0);
SetEventName(eventid, "Massacre");
SetEventType(eventid, EVENT_TYPE_SHOOTOUT);
SetEventRequiredPlayers(eventid, 7);
SetEventOpen(eventid, false);
SetEventActive(eventid, false);
SetEventWeapon(eventid, WEAPON_CHAINSAW, 1);
SetEventSpecialSpawn(eventid, 10.0, 20.0, 15.0);
SetEventWinScore(eventid, 2);
Example for event type "race":
pawn Код:
new
        eventid = 4, a, b;
for(a = 0; a < 2; a++)
{
    for(b = 0; b < 6; b++)
        CreateEventVehicle(eventid, 411, 0.0 + (9.4 * a), 0.0 + (4.0 * b), 5.0, 180.0);
}
SetEventName(eventid, "My Race");
SetEventType(eventid, EVENT_TYPE_RACE);
SetEventRequiredPlayers(eventid, 12);
SetEventOpen(eventid, false);
SetEventActive(eventid, false);
// Only for race/triathlon events.
SetEventRaceCheckpoint(eventid, 10.0, 10.0, 5.0);
SetEventRaceCheckpoint(eventid, 20.0, 20.0, 5.0);
SetEventRaceCheckpoint(eventid, 30.0, 30.0, 5.0);
SetEventRaceCheckpoint(eventid, 40.0, 40.0, 5.0);
SetEventRaceCheckpoint(eventid, 50.0, 50.0, 5.0);
SetEventWinScore(eventid, 10);
Example for event type "skydiving":
pawn Код:
new
        eventid = 5, Float:rot[3], a, b, c;
for(a = 0; a < 15; a++)
{
    CreateEventObject(eventid, 4563, -3250.0, -3250.0, 71.0 + (244.25 * a), 0.0, 0.0, 0.0, 500.0);
    CreateEventObject(eventid, 4563, -3250.0, -3350.0, 71.0 + (244.25 * a), 0.0, 0.0, 0.0, 500.0);
    CreateEventObject(eventid, 4563, -3200.0, -3300.0, 71.0 + (244.25 * a), 0.0, 0.0, 0.0, 500.0);
    CreateEventObject(eventid, 4563, -3300.0, -3300.0, 71.0 + (244.25 * a), 0.0, 0.0, 0.0, 500.0);
    for(b = 0; b < 5; b++)
    {
        switch(random(2))
        {
            case 0:
            {
                modelid = 16114; // des_rockgp2_
                for(c = 0; c < 2; c++)
                    rot[c] = 0.0;
                rot[2] = float(random(360)) + 1.0;
            }
            case 1:
            {
                modelid = (18808 + random(4)); // tube50m1
                for(c = 0; c < 3; c++)
                    rot[c] = float(random(360)) + 1.0;
            }
        }
        CreateEventObject(eventid,
                            modelid,
                            -3250.0 + float(random(15)),
                            -3300.0 + float(random(15)),
                            (244.25 * a) + (48.85 * b) - 121.0,
                            rot[0],
                            rot[1],
                            rot[2],
                            500.0
        );
    }
}
SetEventName(eventid, "Skydiving");
SetEventType(eventid, EVENT_TYPE_SKYDIVE);
SetEventRequiredPlayers(eventid, 10);
SetEventOpen(eventid, false);
SetEventActive(eventid, false);
SetEventSkydiveFinish(eventid, 25.0); // Only for skydiving events.
SetEventSpecialSpawn(eventid, -3250.0, -3300.0, 3651.25);
SetEventWeapon(eventid, WEAPON_PARACHUTE, 1); // You need to create the parachute "weapon", the script doesn't give it automatically.
SetEventWinScore(eventid, 20);
Example for event type "triathlon":
pawn Код:
new
        eventid = 6, a, b;
for(a = 0; a < 2; a++)
{
    for(b = 0; b < 6; b++)
        CreateEventVehicle(eventid, 481, 0.0 + (2.4 * a), 0.0 + (1.8 * b), 5.0, 180.0, 240);
}
SetEventName(eventid, "Triathlon");
SetEventType(eventid, EVENT_TYPE_TRIATHLON);
SetEventRequiredPlayers(eventid, 12);
SetEventOpen(eventid, false);
SetEventActive(eventid, false);
SetEventWeapon(eventid, WEAPON_PARACHUTE, 1);
SetEventSpecialSpawn(eventid, 250.0, 250.0, 1000.0);
// Only for race/triathlon events.
SetEventRaceCheckpoint(eventid, 10.0, 10.0, 5.0);
SetEventRaceCheckpoint(eventid, 20.0, 20.0, 5.0);
SetEventRaceCheckpoint(eventid, 30.0, 30.0, 5.0);
SetEventRaceCheckpoint(eventid, 40.0, 40.0, 5.0);
SetEventRaceCheckpoint(eventid, 50.0, 50.0, 5.0);
SetEventWinScore(eventid, 14);
Example for event type "endurance with vehicle on objects":
pawn Код:
new
        eventid = 7, a;
CreateEventObject(eventid, 18759, 5000.0, 1000.0, 100.0, 0.0, 0.0, 0.0, 100.0);
for(a = 0; a < 2; a++)
    CreateEventVehicle(eventid, (556 + random(2)), 4995.0 + (10.0 * a), 980.0, 111.2, 0.0, 300);
for(a = 0; a < 2; a++)
    CreateEventVehicle(eventid, (556 + random(2)), 4995.0 + (10.0 * a), 1020.0, 111.2, 180.0, 300);
for(a = 0; a < 2; a++)
    CreateEventVehicle(eventid, (556 + random(2)), 5020.0, 995.0 + (10.0 * a), 111.2, 90.0, 300);
for(a = 0; a < 2; a++)
    CreateEventVehicle(eventid, (556 + random(2)), 4980.0, 995.0 + (10.0 * a), 111.2, 270.0, 300);
SetEventName(eventid, "Last Monster standing");
SetEventType(eventid, EVENT_TYPE_VEHICLE_RAM);
SetEventRequiredPlayers(eventid, 8);
SetEventOpen(eventid, false);
SetEventActive(eventid, false);
SetEventHeightLimit(eventid, 101.2); // Only for events with falling type.
SetEventWinScore(eventid, 10);



Important definitions in the script:
  • "MAX_PLAYERS" definition is redefined as 50 players.
  • "MAX_VEHICLES" definition is redefined as 736 vehicles.
  • Set the definitions "MYSQL_SERVER", "MYSQL_USERNAME", "MYSQL_PASSWORD" i "MYSQL_DATABASE" by your own settings.
  • As for the groups, I've already mentioned that above.
  • "GUARD_PUNISH_STATE" definition is setted as 1, which means that script will only send warnings to the Administrators when the guard/protection system detects someone cheating, and it will of course take "illegal" weapons, health and similar things from the cheater. Number 2 means kick from the server, while number 3 means ban from the game for 10 hours.
  • "MAX_EVENTS" definition is the biggest number of events which allows script to load for playing.
  • "MAX_EVENT_OBJECTS" definition is the biggest number of objects which you can create for specific event.
  • "MAX_EVENT_VEHICLES" definition is the biggest number of vehicles which you can create for specific event.
  • "MAX_EVENT_RACE_CHECKPOINTS" definition is the biggest number of checkpoints which you can create for specific event.
  • "MAX_EVENT_WEAPONS" definition is the biggest number of weapons which you can create for specific event.



Help and commands for players:
  • /help
  • /join [event ID]
  • /leave
  • /list
  • /staff
  • /setlang [language ID]
You can join the event only if it's opened, and that is the concern of the Administrators. The event will start when there are enough joined players for the event, or if the Administrator forces the start sooner. If the required number of players for the event is setted to 10, then the event will start when the 10th player joins the event using the "/join [event ID]" command, or better said: when there are 10 joined players who are spawned in the game, or if the Administrator forces the start sooner, but two joined players are needed for that.

http://imageshack.us/a/img801/4010/80977472.png




Help and commands for Administrators:
  • /ahelp
    • Information: Use this command in order to get a list of administrative commands.
  • /ahelp2
    • Information: Use this command in order to get a list of administrative commands.
  • /guard
    • Information: Use this command in order to manage the guard system.
  • /resetscoreall
    • Information: Use this command in order to delete all saved scores from the database and all scores of players who are on the server.
  • /resetscore [part of player name or player ID] [reason]
    • Information: Use this command in order to delete all saved scores of player.
  • /kick [part of player name or player ID] [reason]
    • Information: Use this command in order to kick a player from the server.
  • /ban [part of player name or player ID] [time in seconds] [reason]
    • Information: Use this command in order to ban a player from the game.
  • /unban [part of player name or player ID]
    • Information: Use this command in order to unban a player.
  • /freeze [part of player name or player ID] [time in seconds] [reason]
    • Information: Use this command in order to freeze a player.
  • /unfreeze [part of player name or player ID]
    • Information: Use this command in order to unfreeze a player.
  • /mute [part of player name or player ID] [time in seconds] [reason]
    • Information: Use this command in order to mute a player.
  • /unmute [part of player name or player ID]
    • Information: Use this command in order to unmute a player.
  • /jail [part of player name or player ID] [time in seconds] [reason]
    • Information: Use this command in order to jail a player.
  • /unjail [part of player name or player ID]
    • Information: Use this command in order to unjail a player.
  • /kill [part of player name or player ID] [reason]
    • Information: Use this command in order to kill a player.
  • /teleport [part of player 1 name or player 1 ID] [part of player 2 name or player 2 ID]
    • Information: Use this command in order to teleport one player to the other player.
  • /spawn [part of player name or player ID] [reason]
    • Information: Use this command in order to spawn a player.
  • /open [event ID]
    • Information: Use this command in order to open an event for others to join and play.
  • /close [event ID]
    • Information: Use this command in order to close an event.
  • /setplayers [event ID] [number of players]
    • Information: Use this command in order to set a required number of joined players for event to start.
  • /forcestart [event ID]
    • Information: Use this command in order to start an event by force.
  • /forceclose [event ID]
    • Information: Use this command in order to stop an event by force.
  • /splayer [part of player name or player ID]
    • Information: Use this command in order to spectate a player.
  • /svehicle [ID vozila]
    • Information: Use this command in order to spectate a vehicle.
  • /sstop
    • Information: Use this command in order to stop spectating player/vehicle.
  • /muteall [time in seconds] [reason]
    • Information: Use this command in order to mute all players.
  • /unmuteall
    • Information: Use this command in order to unmute all players.
  • /enterevent [event ID]
    • Information: Use this command in order to enter an event.
http://imageshack.us/a/img19/8975/11246915.png
http://imageshack.us/a/img577/6469/80016736.png




Event opening and running:

Use the "/setplayers" command to set the required number of players for event to start (it needs to be opened of course - "/open" command). If there are 30 players (example) on the server, then set the required number of players for event to 30 if the event is a standard one where there is no special player limit. Give the players some time to join, and if the event doesn't start on its own (players refuse to join the event or some other reason), then use the "/forcestart" command in order to force the event to start.

As for the events with player limit (because of vehicles), it's clear that all 30 players (example) won't be able to participate in the event with 12 vehicles all at once. In this case, you can start multiple events, for example the existing event "Grand Theft Race" with the player limit 12 (because of vehicles) and the existing event "Triathlon" with the player limit 18 (because of vehicles).




Private chat of Administration:

If you're an Administrator, then type "! Message" or "# Message" into the text window (T button) in order to send a message to all other members of Administration.

http://imageshack.us/a/img818/7916/97935615.png
http://imageshack.us/a/img94/9536/65075496.png




Gameplay outside events:

There are many vehicles in the Los Santos city, and you'll get some weapons when you spawn in the game. Player spawn place is random.




Other:

Latest news on the server - player joining/leaving the server; event opening and running; event winner; ... - you can see all those news in the textdraw below.

http://imageshack.us/a/img585/3879/lstevnt.png




Credits:
  • the SA:MP Team for the random player spawn coordinates (gl_spawns.inc file) and vehicle coordinates for Los Santos city (ls_law.txt, ls_airport.txt, ls_gen_inner.txt, ls_gen_outer.txt files),
  • Incognito for GVar and streamer plugin,
  • GStylezzz/BlueG for MySQL plugin,
  • ****** for sscanf plugin and foreach function,
  • ZeeX for ZCMD command processor,
  • RyDeR and JernejL for anti-flood protection,
  • Testers: mafica, Koksildo, Lazo, Korda, Don Locatelli, Techno_RR and House.



Download:
Reply
#2

nyce work bro!!!!


u deserve a +rep!!
Reply
#3

Quote:
Originally Posted by MacTavish12345
Посмотреть сообщение
nyce work bro!!!!


u deserve a +rep!!
Thank you.

By the way, I forgot to delete the "/sp" command (you can find it on lines 5006 - 5019) - it allows Administrators to set any positive number of required players for a valid event (even 1). You can delete it yourself if you want.
Reply
#4

Can you give us and AMX file?
Reply
#5

Quote:
Originally Posted by Smokkr
Посмотреть сообщение
Can you give us and AMX file?
Didn't you read the "Important information on script" and "Important definitions in the script" part? I CAN'T give you the .amx file, you need to compile the .pwn file yourself with your own settings.
Reply
#6

amazing work is a full GM ++REP.
Reply
#7

Seems nice! Gonna try it
Reply
#8

Here's the one more example how to create your own event (example for the type EVENT_TYPE_OBJECT_FALL):

Video:
https://*****.com/70294299

Code:
pawn Код:
new
        eventid, a, b, Float:rot;
for(a = 0; a < 5; a++)
{
    for(b = 0; b < 8; b++)
    {
        if(!(b % 2))    rot =    45.0;
        else            rot =   135.0;
        CreateEventObject(eventid, 3851, -4800.0 + (11.3 * a), -4850.0 + (2.84 * b), 20.0, 0.0, rot, 90.0, 100.0);
    }
}
SetEventName(eventid, "Glass above Water 3");
SetEventType(eventid, EVENT_TYPE_OBJECT_FALL);
SetEventRequiredPlayers(eventid, 10);
SetEventOpen(eventid, false);
SetEventActive(eventid, false);
SetEventHeightLimit(eventid, 2.5); // Only for events with falling type.
SetEventWinScore(eventid, 9);
Reply
#9

Excellent work Corelli! You gave me an idea with that connection via Forum

OFF: Љteta љto si se rastao od CH. Mislim, moћda ti je ovako bolje, ali zajedno ste mogli postići joљ viљe :/
Reply
#10

I m unable to compile script. Compiler hang every time I compile script.
Reply
#11

Quote:
Originally Posted by MA_proking
View Post
I m unable to compile script. Compiler hang every time I compile script.
Compiler stopped working ?
If yes, did you edit something?
Reply
#12

Quote:
Originally Posted by MA_proking
View Post
I m unable to compile script. Compiler hang every time I compile script.
It works just fine for me. Make sure you didn't change anything you shouldn't in the script, and make sure you have the latest include files which are needed for the script.
Reply
#13

Quote:
Originally Posted by MA_proking
View Post
I m unable to compile script. Compiler hang every time I compile script.
Actually, you're right. I've now tried to compile with the latest foreach include file and the compiler stuck. I was using an older version of foreach before.

Here's the link of the older version:
http://www.solidfiles.com/d/02745f8891
Reply
#14

Great gamemode.
Really awesome features
Repped
Reply
#15

Correlli WOW JUST WOW, this looks off the wall cool ? tho where is the db at for MySQL dose it make auto and this bit here connection via Forum dose that ment i can't just go ig and put in my password i have to go to the forums first to register if that is the case i love it love it love it i have been looking for some think like this for a long long long long time now so ty ty ty ty great work bro keep it up +REP 2
Reply
#16

Svaka čast Corelli Rep+
Reply
#17

where can i get the SMF 2.0x you mentioned in the first post? If 'Simple Machines Forum' is the answer then i already did and install plus added the line to the database as stated in first post then compiled the script with correct database information but i get a runtime error 19 seen here, if not then where could i get a copy.
Reply
#18

Quote:
Originally Posted by cree
View Post
where can i get the SMF 2.0x you mentioned in the first post? If 'Simple Machines Forum' is the answer then i already did and install plus added the line to the database as stated in first post then compiled the script with correct database information but i get a runtime error 19 seen here, if not then where could i get a copy.
Put this foreach include and recompile

http://www.solidfiles.com/d/02745f8891
Reply
#19

still the same error bro.
Reply
#20

You didn't put proper plugins in server.cfg or in plugins folder
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)