29.04.2012, 03:51
(
Последний раз редактировалось SuperViper; 25.05.2012 в 02:12.
)
Introduction
This script allows you to organize all of your players into separate groups and allows you to apply your script actions to each group of players seperately.
Functions
Callbacks
Script Settings
Comment this line if you want to use regular 'for' loops instead of the foreach include by ******. To use this, you must have the foreach include.
Comment this line if you want to use regular 'ALS' hooks instead of the y_hooks include by ******. To use this, you must have the y_hooks include or YSI.
This defines how many maximum groups there in the server. The lower the number, the less memory this include uses.
Bugs and Suggestions
Please reply to this thread with your bug report or suggestion for the include. All of these posts will be reviewed carefully and dealt with.
Versions
The download links and the include itself will be updated occasionally.
Version 1.3 - Pastebin | Mediafire | Assembla Direct Download
Version 1.2 - Pastebin | Mediafire | Assembla Direct Download
Version 1.1 - Pastebin | Mediafire
Version 1.0 - Pastebin | Mediafire
Don't want to wait for updates?
I'm currently uploading all of my changes to an Assembla account. Assembla will be updated before updates are released. If you wish to get the files directly from Assembla, use SVN Checkout with this URL: https://subversion.assembla.com/svn/sv-libraries/
My latest updates to Assembla are below:
Changelog
Using
To begin using this include, drag the file to your pawno > includes folder and put
at the top of your script.
Credits
SuperViper - Creating the script
****** - foreach and y_hooks
This script allows you to organize all of your players into separate groups and allows you to apply your script actions to each group of players seperately.
Functions
Function | Action | Returns |
svGroup_Debug(bool: debug) | Toggles script debugging | 1 |
svGroup_SetPlayer(playerid, groupid) | Puts the player in the specified group | 1 |
svGroup_GetPlayer(playerid) | Gets the player's group ID | Player's group ID |
svGroup_CountMembers(groupid) | Counts the amount of members in a group | The amount of members in the group |
svGroup_SetHealth(groupid, Float: Health) | Sets the health of all members in a group | 0 if no members are in the group, otherwise 1 |
svGroup_SetArmor(groupid, Float: Armor) | Sets the armor of all members in a group | 0 if no members are in the group, otherwise 1 |
svGroup_SetSpawn(groupid, Float: sX, Float: sY, Float: sZ, sInterior = 0, sVirtualWorld = 0, Float: sA = 0.0) | Sets the group's spawn position | 1 |
svGroup_SetSpawnInfo(groupid, skin, Float: sHealth = 0.0, Float: sArmor = 0.0, weapon1 = 0, weapon1ammo = 0, weapon2 = 0, weapon3ammo = 0, weapon4 = 0, weapon4ammo = 0, weapon5 = 0, weapon5ammo = 0, color = -1) | Sets the group's spawn information | 1 |
svGroup_ToggleControllable(groupid, bool: controllable) | Toggles if the group's member can control their character or not | 0 if no members are in the group, otherwise 1 |
svGroup_GiveMoney(groupid, money) | Gives the specified group a certain amount of money | 0 if no members are in the group, otherwise 1 |
svGroup_SetVehicleGroup(vehicleid, groupid) | Removes the vehicle from all other groups and sets it to only that group ID | 1 |
svGroup_AddVehicleToGroup(vehicleid, groupid) | Adds a vehicle to a group (allows multiple groups) | 1 |
svGroup_RemoveVehicleFromGroup(vehicleid, groupid) | Removes a vehicle from a group (allows multiple groups) | 1 if the vehicle was in the group, otherwise -1 |
svGroup_IsVehicleInGroup(vehicleid, groupid) | Checks if the vehicle is in a certain group (allows multiple groups) | 1 if the vehicle is in the group, otherwise 0 |
Callbacks
Callback | Call Time | Note |
svGroups_OnPlayerInBlockedCar(playerid, vehicleid, ispassenger, playergroupid) | Called when a player attempts to enter a car which belongs to a group that he isn't a part of | Automatically prevents the player from entering the car |
Script Settings
pawn Код:
#define USE_FOREACH
pawn Код:
#define USE_YHOOKS
pawn Код:
#define GROUP_AMOUNT 15
Bugs and Suggestions
Please reply to this thread with your bug report or suggestion for the include. All of these posts will be reviewed carefully and dealt with.
Versions
The download links and the include itself will be updated occasionally.
Version 1.3 - Pastebin | Mediafire | Assembla Direct Download
Version 1.2 - Pastebin | Mediafire | Assembla Direct Download
Version 1.1 - Pastebin | Mediafire
Version 1.0 - Pastebin | Mediafire
Don't want to wait for updates?
I'm currently uploading all of my changes to an Assembla account. Assembla will be updated before updates are released. If you wish to get the files directly from Assembla, use SVN Checkout with this URL: https://subversion.assembla.com/svn/sv-libraries/
My latest updates to Assembla are below:
Changelog
Version | Change |
Version 1.3 | Allowed vehicles to be added to groups. |
Version 1.2 | Resolved an issue with ALS hooking. |
Version 1.1 | Added svGroup_GiveMoney function. |
Version 1.1 | Resolved an issue with hooking callbacks (completely forgot about that) |
Version 1.0 | Created the script |
Using
To begin using this include, drag the file to your pawno > includes folder and put
pawn Код:
#include <svGroups>
Credits
SuperViper - Creating the script
****** - foreach and y_hooks