25.07.2013, 08:29
(
Последний раз редактировалось RajatPawar; 27.07.2013 в 08:06.
)
Hello. If you struggle to make teams or something.. here's a great include for you! It's very easy to use and was easy to make.
What's this?
You can create AN organisation (click here for wikipedia) with this include. That is, for example, a member group is an organisation. Then this is an include to help you around with the group's function.
Functions:
NOTE: YOU NEED TO DEFINE AN ORGANISATION IN ORDER TO USE THESE FUNCTIONS.
Documentation:
I am going to use this organisation for example:
Examples of usage:
Group chat:
Admin system:
Enjoy!
Download (FIXED WITH MAKE LEADER BUG.)
Keep credits and don't re-release it!
Organisations! (v2)
#include <r_orgs>
#include <r_orgs>
What's this?
You can create AN organisation (click here for wikipedia) with this include. That is, for example, a member group is an organisation. Then this is an include to help you around with the group's function.
Functions:
pawn Код:
native Org_AddPlayer(playerid, Org_id, level);
native Org_ChangeLevel(playerid, Org_id, level);
native Org_IsPlayerIn(playerid, Org_id);
native Org_CountOnlinePlayers(playerid, Org_id);
native Org_MakeLeader(playerid, Org_id);
native Org_KickOutOf(playerid, Org_id);
native Org_Announce(Org_id, const string[], time, style);
native Org_GiveMoney(Org_id, money);
native Org_SendMessage(Org_id, color, const message[]);
native Org_Teleport(Org_id, Float:x, Float:y, Float:z, interior, vwworld);
native Org_Leave(playerid, Org_id);
native Org_ShowTextDraw(Org_id, Text:textdraw);
native Org_ShowDialog(Org_id, dialogid, style, caption[], info[], button1[], button2[]);
native Org_GiveWeapon(Org_id, weaponid, ammo);
native Org_CreateVehicle(Org_id, vehiclemodel, color);
native Org_PlayAudioStream(Org_id, url[]);
native Org_GetPlayerLevel(playerid, Org_id);
native Org_CreateObjectForAll(Org_id, model_id, Float: x_offset_from_player, Float:y_offset_from_player, Float:z_offset_from_player, Float:rX, Float:rY, Float:rZ, Float: drawdistance = 100);
native Org_DestroyObjectForAll(Org_id);
native Org_Attach3DTextLabelToAll(Org_id, const msg[], color, Float:OffsetX, Float:OffsetY, Float:OffsetZ);
native Org_Destroy3DTextLabelForAll(Org_id);
native Org_SetCheckPointForAll(Org_id, Float:x, Float:y, Float:z, Float:size);
native Org_DisableCheckPointForAll(Org_id);
native Org_SetPVarIntForAll(Org_id, varname[], int_value);
native Org_SetPVarFloatForAll(Org_id, varname[], int_value);
native Org_KickAll(Org_id, color, const kick_message[]);
Documentation:
I am going to use this organisation for example:
pawn Код:
#define TEAM_VIP 125
Код:
- native Org_AddPlayer(playerid, Org_id, level);
This function lets you ADD a player to an organisation.
Usage: Org_AddPlayer(playerid, TEAM_VIP, 1);
returns nothing
- native Org_ChangeLevel(playerid, Org_id, level);
returns nothing
This function lets you CHANGE a player's level in an organisation. There is no limit for levels. ( 0 - w/e )
Usage: Org_ChangeLevel(playerid, TEAM_VIP, 4);
- native Org_IsPlayerIn(playerid, Org_id);
This function lets you CHECK if a player is in an organisation.
Usage: if(Org_IsPlayerIn(playerid, TEAM_VIP) )
returns true or false
- native Org_CountOnlinePlayers(Org_id);
This function lets you COUNT the number of online players in an organisation.
Usage: new count = Org_CountOnlinePlayers(TEAM_VIP);
returns the number of online players
- native Org_MakeLeader(playerid, Org_id);
This function lets you MAKE a player leader of his organisation and demotes the previous leader.
Usage: Org_MakeLeader(playerid, TEAM_VIP)
returns nothing
- native Org_KickOutOf(playerid, Org_id);
This function lets you KICK a player out of his organisation.
Usage: Org_KickOutOf(playerid, TEAM_VIP)
returns nothing
- native Org_Announce(Org_id, const string[], time, style);
This function lets you ANNOUNCE some string to every player of an organisation.
Usage: Org_Announce(TEAM_VIP, "Hello", 5000, 4)
returns nothing
- native Org_GiveMoney(Org_id, money);
This function lets you GIVE money to every player in an organisation.
Usage: Org_GiveMoney(TEAM_VIP, 5000);
returns nothing
- native Org_SendMessage(Org_id, color, const message[]);
This function lets you SEND some string to every player of an organisation.
Usage: Org_SendMessage(TEAM_VIP, -1, "Hello")
returns nothing
- native Org_Teleport(Org_id, Float:x, Float:y, Float:z, interior, vwworld);
This function lets you TELEPORT every player in an organisation to some place.
Usage: Org_Teleport(TEAM_VIP, 12.24, 125.1, 12.4, 2, 1)
returns nothing
- native Org_Leave(playerid, Org_id);
This function makes a player LEAVE a player out of some organisation. (Same as Kick)
Usage: Org_Leave(playerid, TEAM_VIP)
returns nothing
- native Org_ShowTextDraw(Org_id, Text:textdraw);
This function lets you SHOW a textdraw to every player of an organisation.
Usage: Org_ShowTextDraw(TEAM_VIP, Text:my_text)
returns nothing
- native Org_ShowDialog(Org_id, dialogid, style, caption[], info[], button1[], button2[]);
This function lets you SHOW a dialog to every player of an organisation.
Usage: Org_ShowDialog(TEAM_VIP, DIALOG_LOGIN)
returns nothing
- native Org_GiveWeapon(Org_id, weaponid, ammo);
This function lets you GIVE a weapon to every player of an organisation.
Usage: Org_GiveWeapon(TEAM_VIP, 31, 999); (Give a M4)
returns nothing
- native Org_CreateVehicle(Org_id, vehiclemodel, color);
This function lets you SPAWN/GIVE/CREATE a vehicle for every player of an organisation.
Usage: Org_CreateVehicle(TEAM_VIP, 411, 0) (Infernus)
returns nothing
- native Org_PlayAudioStream(Org_id, url[]);
This function plays a URL sound to every player of an organisation.
Usage: Org_PlayAudioStream(TEAM_VIP, "www.url.com")
returns nothing
- native Org_GetPlayerLevel(playerid, Org_id);
This function gets a player's level.
Usage: if( Org_GetPlayerLevel(playerid, TEAM_VIP) > 2)...
returns the level.
native Org_CreateObjectForAll(Org_id, model_id, Float: x_offset_from_player, Float:y_offset_from_player, Float:z_offset_from_player, Float:rX, Float:rY, Float:rZ, Float: drawdistance = 100);
This function creates OBJECTS for ALL organisation players' at the offsets from the player.
native Org_DestroyObjectForAll(Org_id);
This function disables ALL organisation players' created objects.
native Org_Attach3DTextLabelToAll(Org_id, const msg[], color, Float:OffsetX, Float:OffsetY, Float:OffsetZ);
This function attaches a text label to ALL organisation players' positions + offsets.
native Org_Destroy3DTextLabelForAll(Org_id);
This function disables ALL organisation players' 3D labels.
native Org_SetCheckPointForAll(Org_id, Float:x, Float:y, Float:z, Float:size);
This function sets ALL organisation players' checkpoints to co-ordinates specified.
native Org_DisableCheckPointForAll(Org_id);
This function disables ALL organisation players' checkpoints to co-ordinates specified.
native Org_SetPVarIntForAll(Org_id, varname[], int_value);
This function sets ALL organisation players' PVar to the ones specified.
native Org_SetPVarFloatForAll(Org_id, varname[], int_value);
This function sets ALL organisation players' FLOAT PVar to the ones specified.
native Org_KickAll(Org_id, color, const kick_message[]);
This function kicks the whole specified organisation out of the server.
Examples of usage:
Group chat:
pawn Код:
public OnPlayerText(playerid, text[])
{
if(Org_IsPlayerIn(playerid, TEAM_VIP))
{
new string[100];
format(string, 100, "%s says: %s", GetPlayerName(playerid), text);
return Org_SendMessage(TEAM_VIP, string, -1);
}
return 1;
}
pawn Код:
#define ADMIN_TEAM 2112
CMD:makeadmin(..)
{
Org_AddPlayer(playerid, ADMIN_TEAM);
}
Download (FIXED WITH MAKE LEADER BUG.)
Keep credits and don't re-release it!
Код:
v1 Released v2 Added functions: native Org_GetPlayerLevel function native Org_CreateObjectForAll function native Org_DestroyObjectForAll function native Org_Attach3DTextLabelToAll function native Org_Destroy3DTextLabelForAll function native Org_SetCheckPointForAll function native Org_DisableCheckPointForAll function native Org_SetPVarIntForAll function native Org_SetPVarFloatForAll function native Org_KickAll function Fixed leader bug Renamed functions from Organisation_ to Org_