Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Made by Dimi
- I recommend you to put that script in your gamemode and it will work perfectly :) */
- #include <a_samp>
- #include <streamer>
- #include <sscanf2>
- #include <YSI_3.1\y_ini>
- #include <YSI_3.1\y_iterate>
- #include <YSI_3.1\y_commands>
- //------------------------------------------------------------------------------
- #define MAX_ORG 20
- #define O_FILE "Organization/ORG_%d.ini"
- #define ORG_NAME 128
- #define ORG_LEADER 32
- #define ORG_MEMBER 32
- #define ORG_RANK 64
- //------------------------------------------------------------------------------
- // Definisane boje
- #define COLOR_RED 0xfa5555AA
- #define COLOR_GREEN 0x33AA33AA
- #define COLOR_WHITE 0xFFFFFFFF
- #define COLOR_ORANGE 0xFFAF00FF
- #define COLOR_PURPLE 0xC2A2DAAA
- //------------------------------------------------------------------------------
- #define DIALOG_ORGCREATE 7
- #define DIALOG_ORGTYPE 8
- #define DIALOG_ORGSKINS 9
- #define DIALOG_ORGRANK1 10
- #define DIALOG_ORGRANK2 11
- #define DIALOG_ORGRANK3 12
- #define DIALOG_ORGRANK4 13
- #define DIALOG_ORGRANK5 14
- #define DIALOG_ORGRANK6 15
- #define DIALOG_ORGINT1 16
- #define DIALOG_ORGINT2 17
- #define DIALOG_LEADER 21
- #define DIALOG_INVITE 22
- #define DIALOG_UNINVITE 23
- #define DIALOG_GIVERANK 24
- #define DIALOG_ALLMEMBERS 25
- #define DIALOG_ORGDELETE 26
- #define DIALOG_ORGEDIT 28
- #define DIALOG_ORGNAME 29
- #define DIALOG_ORGRANKS 30
- #define DIALOG_OSAFE 49
- #define DIALOG_ORGSCREATE 50
- #define DIALOG_SAFE_INFO 51
- #define DIALOG_SAFE_TMATS 52
- #define DIALOG_SAFE_PMATS 53
- #define DIALOG_SAFE_TDRUGS 54
- #define DIALOG_SAFE_PDRUGS 55
- #define DIALOG_SAFE_TMONEY 56
- #define DIALOG_SAFE_DMONEY 57
- #define DIALOG_ORGLIST 66
- //------------------------------------------------------------------------------
- enum xPlayerInfo{ // enum for players stats
- xLevel,
- xAdmin, // if Admin ingame in my mod - by Levels
- xSkin,
- xLeader,
- xMember,
- xRank,
- xDrugs,
- xMats
- }
- new PI[ MAX_PLAYERS ][ xPlayerInfo ];
- //------------------------------------------------------------------------------
- enum oOrgInfo { // enum for organization
- oID,
- oName[ORG_NAME],
- oType,
- oLeader[ORG_LEADER],
- oMember1[ORG_MEMBER],
- oMember2[ORG_MEMBER],
- oMember3[ORG_MEMBER],
- oMember4[ORG_MEMBER],
- oMember5[ORG_MEMBER],
- oMember6[ORG_MEMBER],
- oMember7[ORG_MEMBER],
- oMember8[ORG_MEMBER],
- oMember9[ORG_MEMBER],
- oMember10[ORG_MEMBER],
- oMember11[ORG_MEMBER],
- oMember12[ORG_MEMBER],
- oSkin1,
- oSkin2,
- oSkin3,
- oSkin4,
- oSkin5,
- oSkin6,
- oRank1[ORG_RANK],
- oRank2[ORG_RANK],
- oRank3[ORG_RANK],
- oRank4[ORG_RANK],
- oRank5[ORG_RANK],
- oRank6[ORG_RANK],
- Float:oPosExtX,
- Float:oPosExtY,
- Float:oPosExtZ,
- Float:oPosIntX,
- Float:oPosIntY,
- Float:oPosIntZ,
- oVehicle_1,
- Float:oVehicle_1_PosX,
- Float:oVehicle_1_PosY,
- Float:oVehicle_1_PosZ,
- Float:oVehicle_1_PosA,
- oVehicle_2,
- Float:oVehicle_2_PosX,
- Float:oVehicle_2_PosY,
- Float:oVehicle_2_PosZ,
- Float:oVehicle_2_PosA,
- oVehicle_3,
- Float:oVehicle_3_PosX,
- Float:oVehicle_3_PosY,
- Float:oVehicle_3_PosZ,
- Float:oVehicle_3_PosA,
- oVehicle_4,
- Float:oVehicle_4_PosX,
- Float:oVehicle_4_PosY,
- Float:oVehicle_4_PosZ,
- Float:oVehicle_4_PosA,
- oVehicle_5,
- Float:oVehicle_5_PosX,
- Float:oVehicle_5_PosY,
- Float:oVehicle_5_PosZ,
- Float:oVehicle_5_PosA,
- oVehicle_6,
- Float:oVehicle_6_PosX,
- Float:oVehicle_6_PosY,
- Float:oVehicle_6_PosZ,
- Float:oVehicle_6_PosA,
- oVehicle_7,
- Float:oVehicle_7_PosX,
- Float:oVehicle_7_PosY,
- Float:oVehicle_7_PosZ,
- Float:oVehicle_7_PosA,
- oVehicle_8,
- Float:oVehicle_8_PosX,
- Float:oVehicle_8_PosY,
- Float:oVehicle_8_PosZ,
- Float:oVehicle_8_PosA,
- oVehicle_9,
- Float:oVehicle_9_PosX,
- Float:oVehicle_9_PosY,
- Float:oVehicle_9_PosZ,
- Float:oVehicle_9_PosA,
- oVehicle_10,
- Float:oVehicle_10_PosX,
- Float:oVehicle_10_PosY,
- Float:oVehicle_10_PosZ,
- Float:oVehicle_10_PosA,
- oVehicle_11,
- Float:oVehicle_11_PosX,
- Float:oVehicle_11_PosY,
- Float:oVehicle_11_PosZ,
- Float:oVehicle_11_PosA,
- oVehicle_12,
- Float:oVehicle_12_PosX,
- Float:oVehicle_12_PosY,
- Float:oVehicle_12_PosZ,
- Float:oVehicle_12_PosA,
- oColor_1,
- oColor_2,
- oInt,
- oVw,
- oSafe,
- Float:oSafePosX,
- Float:oSafePosY,
- Float:oSafePosZ,
- oSafeMats,
- oSafeDrugs,
- oSafeMoney
- }
- new OI[ MAX_ORG ][ oOrgInfo ];
- new OrgPickup[ MAX_ORG ];
- new OrgVehicle[ MAX_ORG ][ 12 ];
- new Text3D:Org3D[ MAX_ORG ];
- new Text3D:OrgSafeLabel[ MAX_ORG ];
- new OrgSafePickup[ MAX_ORG ];
- new OrgCreate[ MAX_PLAYERS ]; // difference between creating and editing in dialogs
- //------------------------------------------------------------------------------
- IsPlayerNearOrganization(playerid) {
- for(new b = 1; b < MAX_ORG; b++) {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, OI[ b ][ oPosExtX], OI[ b ][ oPosExtY], OI[ b ][ oPosExtZ])) return b; }
- return -1;
- }
- //------------------------------------------------------------------------------
- stock Orge3D(id) { // updating organization labels on chaning leader,create ....
- new string[ 400 ];
- Delete3DTextLabel( OrgSafeLabel[ id ] );
- DestroyPickup( OrgSafePickup[ id ] );
- Delete3DTextLabel( Org3D[ id ] );
- DestroyPickup( OrgPickup[ id ] );
- format( string,sizeof( string ),"{FFFFFF}%s\n{FF6200}Leader: {FFFFFF}%s\n{FF6200}For entrance click\n{FFFFFF}'ENTER'", OI[ id ][ oName], OI[ id ][ oLeader ]);
- Org3D[ id ] = Create3DTextLabel( string ,COLOR_GREEN, OI[ id ][ oPosExtX ], OI[ id ][ oPosExtY ], OI[ id ][ oPosExtZ ], 25, 0, 1);
- OrgPickup[ id ] = CreateDynamicPickup( 1314, 1, OI[ id ][ oPosExtX ], OI[ id ][ oPosExtY ], OI[ id ][ oPosExtZ ]);
- if( OI[ id ][ oSafe ] == 1) {
- OrgSafeLabel[ id ] = Create3DTextLabel( "{FF6200}Press {FFFFFF}'SPACE' {FF6200}to open safe menu{FF6200}" ,COLOR_GREEN, OI[ id ][ oSafePosX ], OI[ id ][ oSafePosY ], OI[ id ][ oSafePosZ ], 25, OI[ id ][ oVw ], 1);
- OrgSafePickup[ id ] = CreateDynamicPickup( 1239, 1, OI[ id ][ oSafePosX ], OI[ id ][ oSafePosY ], OI[ id ][ oSafePosZ ], OI[ id ][ oVw ] ); }
- return true;
- }
- //------------------------------------------------------------------------------
- stock PlayerName(id)
- {
- new ime[MAX_PLAYER_NAME];
- GetPlayerName(id, ime, sizeof ime);
- return ime;
- }
- //------------------------------------------------------------------------------
- IsNumeric(const string[]) {
- for (new i = 0, j = strlen(string); i < j; i++) {
- if (string[i] > '9' || string[i] < '0') return false; }
- return true;
- }
- //------------------------------------------------------------------------------
- stock OrgMessage(orgid, color, string[]) {
- foreach(Player, i) {
- if( PI[ i ][ xMember ] == orgid || PI[ i ][ xLeader ] == orgid ) {
- SendClientMessage( i, color, string ); } }
- return true;
- }
- //------------------------------------------------------------------------------
- forward ProxDetector( Float:Radius, playerid, string[], col1);
- public ProxDetector(Float:Radius, playerid, string[], col1)
- {
- new Float:PozX, Float:PozY, Float:PozZ;
- GetPlayerPos(playerid, PozX, PozY, PozZ);
- foreach( Player, i) {
- if( IsPlayerConnected( i ) && ( GetPlayerVirtualWorld( playerid ) == GetPlayerVirtualWorld( i ) ) ) {
- if( IsPlayerInRangeOfPoint( i, Radius, PozX, PozY, PozZ ) ) {
- SendClientMessage(i, col1, string); } } }
- return true;
- }
- //------------------------------------------------------------------------------
- forward SaveOrganization(id); // Save organization stats
- public SaveOrganization(id)
- {
- new org_file[ 40 ];
- format (org_file, sizeof( org_file ), O_FILE, id );
- new INI:File = INI_Open( org_file );
- INI_SetTag( File, "Organizacija");
- INI_WriteInt( File, "ID", OI[ id ][ oID ]);
- INI_WriteString( File, "Name", OI[ id ][ oName ]);
- INI_WriteInt( File, "Type", OI[ id ][ oType ]);
- INI_WriteString( File, "Leader", OI[ id ][ oLeader ]);
- INI_WriteString( File, "Member1", OI[ id ][ oMember1 ]);
- INI_WriteString( File, "Member2", OI[ id ][ oMember2 ]);
- INI_WriteString( File, "Member3", OI[ id ][ oMember3 ]);
- INI_WriteString( File, "Member4", OI[ id ][ oMember4 ]);
- INI_WriteString( File, "Member5", OI[ id ][ oMember5 ]);
- INI_WriteString( File, "Member6", OI[ id ][ oMember6 ]);
- INI_WriteString( File, "Member7", OI[ id ][ oMember7 ]);
- INI_WriteString( File, "Member8", OI[ id ][ oMember8 ]);
- INI_WriteString( File, "Member9", OI[ id ][ oMember9 ]);
- INI_WriteString( File, "Member10", OI[ id ][ oMember10 ]);
- INI_WriteString( File, "Member11", OI[ id ][ oMember11 ]);
- INI_WriteString( File, "Member12", OI[ id ][ oMember12 ]);
- INI_WriteInt( File, "Skin1", OI[ id ][ oSkin1 ]);
- INI_WriteInt( File, "Skin2", OI[ id ][ oSkin2 ]);
- INI_WriteInt( File, "Skin3", OI[ id ][ oSkin3 ]);
- INI_WriteInt( File, "Skin4", OI[ id ][ oSkin4 ]);
- INI_WriteInt( File, "Skin5", OI[ id ][ oSkin5 ]);
- INI_WriteInt( File, "Skin6", OI[ id ][ oSkin6 ]);
- INI_WriteString( File, "Rank1", OI[ id ][ oRank1 ]);
- INI_WriteString( File, "Rank2", OI[ id ][ oRank2 ]);
- INI_WriteString( File, "Rank3", OI[ id ][ oRank3 ]);
- INI_WriteString( File, "Rank4", OI[ id ][ oRank4 ]);
- INI_WriteString( File, "Rank5", OI[ id ][ oRank5 ]);
- INI_WriteString( File, "Rank6", OI[ id ][ oRank6 ]);
- INI_WriteFloat( File, "PosExtX", OI[ id ][ oPosExtX ]);
- INI_WriteFloat( File, "PosExtY", OI[ id ][ oPosExtY ]);
- INI_WriteFloat( File, "PosExtZ", OI[ id ][ oPosExtZ ]);
- INI_WriteFloat( File, "PosIntX", OI[ id ][ oPosIntX ]);
- INI_WriteFloat( File, "PosIntY", OI[ id ][ oPosIntY ]);
- INI_WriteFloat( File, "PosIntZ", OI[ id ][ oPosIntZ ]);
- INI_WriteInt( File, "Vehicle_1", OI[id][oVehicle_1]);
- INI_WriteFloat( File, "Vehicle_1_PosX", OI[id][oVehicle_1_PosX]);
- INI_WriteFloat( File, "Vehicle_1_PosY", OI[id][oVehicle_1_PosY]);
- INI_WriteFloat( File, "Vehicle_1_PosZ", OI[id][oVehicle_1_PosZ]);
- INI_WriteFloat( File, "Vehicle_1_PosA", OI[id][oVehicle_1_PosA]);
- INI_WriteInt( File, "Vehicle_2", OI[id][oVehicle_2]);
- INI_WriteFloat( File, "Vehicle_2_PosX", OI[id][oVehicle_2_PosX]);
- INI_WriteFloat( File, "Vehicle_2_PosY", OI[id][oVehicle_2_PosY]);
- INI_WriteFloat( File, "Vehicle_2_PosZ", OI[id][oVehicle_2_PosZ]);
- INI_WriteFloat( File, "Vehicle_2_PosA", OI[id][oVehicle_2_PosA]);
- INI_WriteInt( File, "Vehicle_3", OI[id][oVehicle_3]);
- INI_WriteFloat( File, "Vehicle_3_PosX", OI[id][oVehicle_3_PosX]);
- INI_WriteFloat( File, "Vehicle_3_PosY", OI[id][oVehicle_3_PosY]);
- INI_WriteFloat( File, "Vehicle_3_PosZ", OI[id][oVehicle_3_PosZ]);
- INI_WriteFloat( File, "Vehicle_3_PosA", OI[id][oVehicle_3_PosA]);
- INI_WriteInt( File, "Vehicle_4", OI[id][oVehicle_4]);
- INI_WriteFloat( File, "Vehicle_4_PosX", OI[id][oVehicle_4_PosX]);
- INI_WriteFloat( File, "Vehicle_4_PosY", OI[id][oVehicle_4_PosY]);
- INI_WriteFloat( File, "Vehicle_4_PosZ", OI[id][oVehicle_4_PosZ]);
- INI_WriteFloat( File, "Vehicle_4_PosA", OI[id][oVehicle_4_PosA]);
- INI_WriteInt( File, "Vehicle_5", OI[id][oVehicle_5]);
- INI_WriteFloat( File, "Vehicle_5_PosX", OI[id][oVehicle_5_PosX]);
- INI_WriteFloat( File, "Vehicle_5_PosY", OI[id][oVehicle_5_PosY]);
- INI_WriteFloat( File, "Vehicle_5_PosZ", OI[id][oVehicle_5_PosZ]);
- INI_WriteFloat( File, "Vehicle_5_PosA", OI[id][oVehicle_5_PosA]);
- INI_WriteInt( File, "Vehicle_6", OI[id][oVehicle_6]);
- INI_WriteFloat( File, "Vehicle_6_PosX", OI[id][oVehicle_6_PosX]);
- INI_WriteFloat( File, "Vehicle_6_PosY", OI[id][oVehicle_6_PosY]);
- INI_WriteFloat( File, "Vehicle_6_PosZ", OI[id][oVehicle_6_PosZ]);
- INI_WriteFloat( File, "Vehicle_6_PosA", OI[id][oVehicle_6_PosA]);
- INI_WriteInt( File, "Vehicle_7", OI[id][oVehicle_7]);
- INI_WriteFloat( File, "Vehicle_7_PosX", OI[id][oVehicle_7_PosX]);
- INI_WriteFloat( File, "Vehicle_7_PosY", OI[id][oVehicle_7_PosY]);
- INI_WriteFloat( File, "Vehicle_7_PosZ", OI[id][oVehicle_7_PosZ]);
- INI_WriteFloat( File, "Vehicle_7_PosA", OI[id][oVehicle_7_PosA]);
- INI_WriteInt( File, "Vehicle_8", OI[id][oVehicle_8]);
- INI_WriteFloat( File, "Vehicle_8_PosX", OI[id][oVehicle_8_PosX]);
- INI_WriteFloat( File, "Vehicle_8_PosY", OI[id][oVehicle_8_PosY]);
- INI_WriteFloat( File, "Vehicle_8_PosZ", OI[id][oVehicle_8_PosZ]);
- INI_WriteFloat( File, "Vehicle_8_PosA", OI[id][oVehicle_8_PosA]);
- INI_WriteInt( File, "Vehicle_9", OI[id][oVehicle_9]);
- INI_WriteFloat( File, "Vehicle_9_PosX", OI[id][oVehicle_9_PosX]);
- INI_WriteFloat( File, "Vehicle_9_PosY", OI[id][oVehicle_9_PosY]);
- INI_WriteFloat( File, "Vehicle_9_PosZ", OI[id][oVehicle_9_PosZ]);
- INI_WriteFloat( File, "Vehicle_9_PosA", OI[id][oVehicle_9_PosA]);
- INI_WriteInt( File, "Vehicle_10", OI[id][oVehicle_10]);
- INI_WriteFloat( File, "Vehicle_10_PosX", OI[id][oVehicle_10_PosX]);
- INI_WriteFloat( File, "Vehicle_10_PosY", OI[id][oVehicle_10_PosY]);
- INI_WriteFloat( File, "Vehicle_10_PosZ", OI[id][oVehicle_10_PosZ]);
- INI_WriteFloat( File, "Vehicle_10_PosA", OI[id][oVehicle_10_PosA]);
- INI_WriteInt( File, "Vehicle_11", OI[id][oVehicle_11]);
- INI_WriteFloat( File, "Vehicle_11_PosX", OI[id][oVehicle_11_PosX]);
- INI_WriteFloat( File, "Vehicle_11_PosY", OI[id][oVehicle_11_PosY]);
- INI_WriteFloat( File, "Vehicle_11_PosZ", OI[id][oVehicle_11_PosZ]);
- INI_WriteFloat( File, "Vehicle_11_PosA", OI[id][oVehicle_11_PosA]);
- INI_WriteInt( File, "Vehicle_12", OI[id][oVehicle_12]);
- INI_WriteFloat( File, "Vehicle_12_PosX", OI[id][oVehicle_12_PosX]);
- INI_WriteFloat( File, "Vehicle_12_PosY", OI[id][oVehicle_12_PosY]);
- INI_WriteFloat( File, "Vehicle_12_PosZ", OI[id][oVehicle_12_PosZ]);
- INI_WriteFloat( File, "Vehicle_12_PosA", OI[id][oVehicle_12_PosA]);
- INI_WriteInt( File, "Color_1", OI[id][oColor_1]);
- INI_WriteInt( File, "Color_2", OI[id][oColor_2]);
- INI_WriteInt( File, "Int", OI[ id ][ oInt ]);
- INI_WriteInt( File, "Vw", OI[ id ][ oVw ]);
- INI_WriteInt( File, "Safe", OI[ id ][ oSafe ]);
- INI_WriteFloat( File, "SafePosX", OI[ id ][ oSafePosX ]);
- INI_WriteFloat( File, "SafePosY", OI[ id ][ oSafePosY ]);
- INI_WriteFloat( File, "SafePosZ", OI[ id ][ oSafePosZ ]);
- INI_WriteInt( File, "SafeMats", OI[ id ][ oSafeMats ]);
- INI_WriteInt( File, "SafeDrugs", OI[ id ][ oSafeDrugs ]);
- INI_WriteInt( File, "SafeMoney", OI[ id ][ oSafeMoney ]);
- INI_Close( File );
- return 1;
- }
- //------------------------------------------------------------------------------
- forward LoadOrganization(id, name[], value[]); // Load organization
- public LoadOrganization(id, name[], value[])
- {
- INI_Int( "ID", OI[ id ][ oID]);
- INI_String( "Name", OI[ id ][ oName], ORG_NAME);
- INI_String( "Leader", OI[ id ][ oLeader], ORG_LEADER);
- INI_Int( "Type", OI[ id ][ oType]);
- INI_String( "Member1", OI[ id ][ oMember1], ORG_MEMBER);
- INI_String( "Member2", OI[ id ][ oMember2], ORG_MEMBER);
- INI_String( "Member3", OI[ id ][ oMember3], ORG_MEMBER);
- INI_String( "Member4", OI[ id ][ oMember4], ORG_MEMBER);
- INI_String( "Member5", OI[ id ][ oMember5], ORG_MEMBER);
- INI_String( "Member6", OI[ id ][ oMember6], ORG_MEMBER);
- INI_String( "Member7", OI[ id ][ oMember7], ORG_MEMBER);
- INI_String( "Member8", OI[ id ][ oMember8], ORG_MEMBER);
- INI_String( "Member9", OI[ id ][ oMember9], ORG_MEMBER);
- INI_String( "Member10", OI[ id ][ oMember10], ORG_MEMBER);
- INI_String( "Member11", OI[ id ][ oMember11], ORG_MEMBER);
- INI_String( "Member12", OI[ id ][ oMember12], ORG_MEMBER);
- INI_Int( "Skin1", OI[ id ][ oSkin1]);
- INI_Int( "Skin2", OI[ id ][ oSkin2]);
- INI_Int( "Skin3", OI[ id ][ oSkin3]);
- INI_Int( "Skin4", OI[ id ][ oSkin4]);
- INI_Int( "Skin5", OI[ id ][ oSkin5]);
- INI_Int( "Skin6", OI[ id ][ oSkin6]);
- INI_String( "Rank1", OI[ id ][ oRank1], ORG_RANK);
- INI_String( "Rank2", OI[ id ][ oRank2], ORG_RANK);
- INI_String( "Rank3", OI[ id ][ oRank3], ORG_RANK);
- INI_String( "Rank4", OI[ id ][ oRank4], ORG_RANK);
- INI_String( "Rank5", OI[ id ][ oRank5], ORG_RANK);
- INI_String( "Rank6", OI[ id ][ oRank6], ORG_RANK);
- INI_Float( "PosExtX", OI[ id ][ oPosExtX]);
- INI_Float( "PosExtY", OI[ id ][ oPosExtY]);
- INI_Float( "PosExtZ", OI[ id ][ oPosExtZ]);
- INI_Float( "PosIntX", OI[ id ][ oPosIntX]);
- INI_Float( "PosIntY", OI[ id ][ oPosIntY]);
- INI_Float( "PosIntZ", OI[ id ][ oPosIntZ]);
- INI_Int("Vehicle_1", OI[id][oVehicle_1]);
- INI_Float("Vehicle_1_PosX", OI[id][oVehicle_1_PosX]);
- INI_Float("Vehicle_1_PosY", OI[id][oVehicle_1_PosY]);
- INI_Float("Vehicle_1_PosZ", OI[id][oVehicle_1_PosZ]);
- INI_Float("Vehicle_1_PosA", OI[id][oVehicle_1_PosA]);
- INI_Int("Vehicle_2", OI[id][oVehicle_2]);
- INI_Float("Vehicle_2_PosX", OI[id][oVehicle_2_PosX]);
- INI_Float("Vehicle_2_PosY", OI[id][oVehicle_2_PosY]);
- INI_Float("Vehicle_2_PosZ", OI[id][oVehicle_2_PosZ]);
- INI_Float("Vehicle_2_PosA", OI[id][oVehicle_2_PosA]);
- INI_Int("Vehicle_3", OI[id][oVehicle_3]);
- INI_Float("Vehicle_3_PosX", OI[id][oVehicle_3_PosX]);
- INI_Float("Vehicle_3_PosY", OI[id][oVehicle_3_PosY]);
- INI_Float("Vehicle_3_PosZ", OI[id][oVehicle_3_PosZ]);
- INI_Float("Vehicle_3_PosA", OI[id][oVehicle_3_PosA]);
- INI_Int("Vehicle_4", OI[id][oVehicle_4]);
- INI_Float("Vehicle_4_PosX", OI[id][oVehicle_4_PosX]);
- INI_Float("Vehicle_4_PosY", OI[id][oVehicle_4_PosY]);
- INI_Float("Vehicle_4_PosZ", OI[id][oVehicle_4_PosZ]);
- INI_Float("Vehicle_4_PosA", OI[id][oVehicle_4_PosA]);
- INI_Int("Vehicle_5", OI[id][oVehicle_5]);
- INI_Float("Vehicle_5_PosX", OI[id][oVehicle_5_PosX]);
- INI_Float("Vehicle_5_PosY", OI[id][oVehicle_5_PosY]);
- INI_Float("Vehicle_5_PosZ", OI[id][oVehicle_5_PosZ]);
- INI_Float("Vehicle_5_PosA", OI[id][oVehicle_5_PosA]);
- INI_Int("Vehicle_6", OI[id][oVehicle_6]);
- INI_Float("Vehicle_6_PosX", OI[id][oVehicle_6_PosX]);
- INI_Float("Vehicle_6_PosY", OI[id][oVehicle_6_PosY]);
- INI_Float("Vehicle_6_PosZ", OI[id][oVehicle_6_PosZ]);
- INI_Float("Vehicle_6_PosA", OI[id][oVehicle_6_PosA]);
- INI_Int("Vehicle_7", OI[id][oVehicle_7]);
- INI_Float("Vehicle_7_PosX", OI[id][oVehicle_7_PosX]);
- INI_Float("Vehicle_7_PosY", OI[id][oVehicle_7_PosY]);
- INI_Float("Vehicle_7_PosZ", OI[id][oVehicle_7_PosZ]);
- INI_Float("Vehicle_7_PosA", OI[id][oVehicle_7_PosA]);
- INI_Int("Vehicle_8", OI[id][oVehicle_8]);
- INI_Float("Vehicle_8_PosX", OI[id][oVehicle_8_PosX]);
- INI_Float("Vehicle_8_PosY", OI[id][oVehicle_8_PosY]);
- INI_Float("Vehicle_8_PosZ", OI[id][oVehicle_8_PosZ]);
- INI_Float("Vehicle_8_PosA", OI[id][oVehicle_8_PosA]);
- INI_Int("Vehicle_9", OI[id][oVehicle_9]);
- INI_Float("Vehicle_9_PosX", OI[id][oVehicle_9_PosX]);
- INI_Float("Vehicle_9_PosY", OI[id][oVehicle_9_PosY]);
- INI_Float("Vehicle_9_PosZ", OI[id][oVehicle_9_PosZ]);
- INI_Float("Vehicle_9_PosA", OI[id][oVehicle_9_PosA]);
- INI_Int("Vehicle_10", OI[id][oVehicle_10]);
- INI_Float("Vehicle_10_PosX", OI[id][oVehicle_10_PosX]);
- INI_Float("Vehicle_10_PosY", OI[id][oVehicle_10_PosY]);
- INI_Float("Vehicle_10_PosZ", OI[id][oVehicle_10_PosZ]);
- INI_Float("Vehicle_10_PosA", OI[id][oVehicle_10_PosA]);
- INI_Int("Vehicle_11", OI[id][oVehicle_11]);
- INI_Float("Vehicle_11_PosX", OI[id][oVehicle_11_PosX]);
- INI_Float("Vehicle_11_PosY", OI[id][oVehicle_11_PosY]);
- INI_Float("Vehicle_11_PosZ", OI[id][oVehicle_11_PosZ]);
- INI_Float("Vehicle_11_PosA", OI[id][oVehicle_11_PosA]);
- INI_Int("Vehicle_12", OI[id][oVehicle_12]);
- INI_Float("Vehicle_12_PosX", OI[id][oVehicle_12_PosX]);
- INI_Float("Vehicle_12_PosY", OI[id][oVehicle_12_PosY]);
- INI_Float("Vehicle_12_PosZ", OI[id][oVehicle_12_PosZ]);
- INI_Float("Vehicle_12_PosA", OI[id][oVehicle_12_PosA]);
- INI_Int( "Color_1", OI[id][oColor_1]);
- INI_Int( "Color_2", OI[id][oColor_2]);
- INI_Int( "Safe", OI[ id ][ oSafe ]);
- INI_Float( "SafePosX", OI[ id ][ oSafePosX ]);
- INI_Float( "SafePosY", OI[ id ][ oSafePosY ]);
- INI_Float( "SafePosZ", OI[ id ][ oSafePosZ ]);
- INI_Int( "SafeMats", OI[ id ][ oSafeMats ]);
- INI_Int( "SafeDrugs", OI[ id ][ oSafeDrugs ]);
- INI_Int( "SafeMoney", OI[ id ][ oSafeMoney ]);
- INI_Int( "Int", OI[ id ][ oInt]);
- INI_Int( "Vw", OI[ id ][ oVw ]);
- return 1;
- }
- public OnGameModeInit() // that must go in gamemode
- {
- for( new id = 1; id < MAX_ORG; id++ ) // loading organization,safe adn vehicles
- {
- new oFile[ 50 ], string10[ 256 ];
- format( oFile, sizeof( oFile ), O_FILE, id );
- if( fexist( oFile ) )
- {
- INI_ParseFile(oFile, "LoadOrganization", .bExtra = true, .extra = id);
- OrgPickup[ id ] = CreateDynamicPickup(1314, 1, OI[id][ oPosExtX ], OI[ id ][ oPosExtY ], OI[ id ][ oPosExtZ ] );
- format(string10,sizeof(string10),"{FFFFFF}%s\n{FF6200}Leader: {FFFFFF}%s\n{FF6200}For entrance click\n{FFFFFF}'ENTER'", OI[ id ][ oName ], OI[ id ][ oLeader ] );
- if( OI[ id ][ oVehicle_1 ] != 0 ) { OrgVehicle[id][0] = CreateVehicle(OI[id][oVehicle_1], OI[id][oVehicle_1_PosX], OI[id][oVehicle_1_PosY], OI[id][oVehicle_1_PosZ], OI[id][oVehicle_1_PosA], OI[id][oColor_1], OI[id][oColor_2], -1); }
- if( OI[ id ][ oVehicle_2 ] != 0 ) { OrgVehicle[id][1] = CreateVehicle(OI[id][oVehicle_2], OI[id][oVehicle_2_PosX], OI[id][oVehicle_2_PosY], OI[id][oVehicle_2_PosZ], OI[id][oVehicle_2_PosA], OI[id][oColor_1], OI[id][oColor_2], -1); }
- if( OI[ id ][ oVehicle_3 ] != 0 ) { OrgVehicle[id][2] = CreateVehicle(OI[id][oVehicle_3], OI[id][oVehicle_3_PosX], OI[id][oVehicle_3_PosY], OI[id][oVehicle_3_PosZ], OI[id][oVehicle_3_PosA], OI[id][oColor_1], OI[id][oColor_2], -1); }
- if( OI[ id ][ oVehicle_4 ] != 0 ) { OrgVehicle[id][3] = CreateVehicle(OI[id][oVehicle_4], OI[id][oVehicle_4_PosX], OI[id][oVehicle_4_PosY], OI[id][oVehicle_4_PosZ], OI[id][oVehicle_4_PosA], OI[id][oColor_1], OI[id][oColor_2], -1); }
- if( OI[ id ][ oVehicle_5 ] != 0 ) { OrgVehicle[id][4] = CreateVehicle(OI[id][oVehicle_5], OI[id][oVehicle_5_PosX], OI[id][oVehicle_5_PosY], OI[id][oVehicle_5_PosZ], OI[id][oVehicle_5_PosA], OI[id][oColor_1], OI[id][oColor_2], -1); }
- if( OI[ id ][ oVehicle_6 ] != 0 ) { OrgVehicle[id][5] = CreateVehicle(OI[id][oVehicle_6], OI[id][oVehicle_6_PosX], OI[id][oVehicle_6_PosY], OI[id][oVehicle_6_PosZ], OI[id][oVehicle_6_PosA], OI[id][oColor_1], OI[id][oColor_2], -1); }
- if( OI[ id ][ oVehicle_7 ] != 0 ) { OrgVehicle[id][6] = CreateVehicle(OI[id][oVehicle_7], OI[id][oVehicle_7_PosX], OI[id][oVehicle_7_PosY], OI[id][oVehicle_7_PosZ], OI[id][oVehicle_7_PosA], OI[id][oColor_1], OI[id][oColor_2], -1); }
- if( OI[ id ][ oVehicle_8 ] != 0 ) { OrgVehicle[id][7] = CreateVehicle(OI[id][oVehicle_8], OI[id][oVehicle_8_PosX], OI[id][oVehicle_8_PosY], OI[id][oVehicle_8_PosZ], OI[id][oVehicle_8_PosA], OI[id][oColor_1], OI[id][oColor_2], -1); }
- if( OI[ id ][ oVehicle_9 ] != 0 ) { OrgVehicle[id][8] = CreateVehicle(OI[id][oVehicle_9], OI[id][oVehicle_9_PosX], OI[id][oVehicle_9_PosY], OI[id][oVehicle_9_PosZ], OI[id][oVehicle_9_PosA], OI[id][oColor_1], OI[id][oColor_2], -1); }
- if( OI[ id ][ oVehicle_10 ] != 0 ) { OrgVehicle[id][9] = CreateVehicle(OI[id][oVehicle_10], OI[id][oVehicle_10_PosX], OI[id][oVehicle_10_PosY], OI[id][oVehicle_10_PosZ], OI[id][oVehicle_10_PosA], OI[id][oColor_1], OI[id][oColor_2], -1); }
- if( OI[ id ][ oVehicle_11 ] != 0 ) { OrgVehicle[id][10] = CreateVehicle(OI[id][oVehicle_11], OI[id][oVehicle_11_PosX], OI[id][oVehicle_11_PosY], OI[id][oVehicle_11_PosZ], OI[id][oVehicle_11_PosA], OI[id][oColor_1], OI[id][oColor_2], -1); }
- if( OI[ id ][ oVehicle_12 ] != 0 ) { OrgVehicle[id][11] = CreateVehicle(OI[id][oVehicle_12], OI[id][oVehicle_12_PosX], OI[id][oVehicle_12_PosY], OI[id][oVehicle_12_PosZ], OI[id][oVehicle_12_PosA], OI[id][oColor_1], OI[id][oColor_2], -1); }
- Org3D[ id ] = Create3DTextLabel(string10 ,COLOR_GREEN, OI[ id ][ oPosExtX ], OI[ id ][oPosExtY ], OI[ id ][ oPosExtZ ], 25, 0, 1 );
- OrgSafeLabel[ id ] = Create3DTextLabel( "{FF6200}Press {FFFFFF}'SPACE' {FF6200}to open safe menu{FF6200}" ,COLOR_GREEN, OI[ id ][ oSafePosX ], OI[ id ][ oSafePosY ], OI[ id ][ oSafePosZ ], 25, OI[ id ][ oVw ], 1);
- OrgSafePickup[ id ] = CreateDynamicPickup( 1239, 1, OI[ id ][ oSafePosX ], OI[ id ][ oSafePosY ], OI[ id ][ oSafePosZ ], OI[ id ][ oVw ] );
- Orge3D( id );
- }
- }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- OrgCreate[ playerid ] = 0;
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if( PI[ playerid ][ xMember ] != 0 ) // spawn in base if player is member of organization
- {
- new OrgID = PI[ playerid ][ xMember ];
- SetPlayerPos( playerid, OI[ OrgID ][ oPosIntX ], OI[ OrgID ][ oPosIntY ] , OI[ OrgID ][ oPosIntZ ] );
- SetPlayerHealth( playerid, 40 );
- SetCameraBehindPlayer( playerid );
- SetPlayerInterior( playerid, OI[ OrgID ][ oInt ] );
- SetPlayerVirtualWorld( playerid, OI[ OrgID ][ oVw ]);
- }
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if( newstate == PLAYER_STATE_DRIVER ) // Enter Vehicle of organization
- {
- for( new i = 1; i < MAX_ORG; i++ )
- {
- for(new d = 0; d < 12; d++)
- {
- if( GetPlayerVehicleID(playerid) == OrgVehicle[ i ][ d ] ) {
- new OrgID = PI[ playerid ][ xMember ];
- if( OrgID == i ) { }
- else
- {
- SendClientMessage( playerid, COLOR_RED, "You have not keys of that vehicle." );
- RemovePlayerFromVehicle( playerid);
- TogglePlayerControllable( playerid, 1 );
- }
- }
- }
- }
- }
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(newkeys == KEY_SECONDARY_ATTACK) // enter/exit from interior of organization
- {
- if(GetPlayerState(playerid) == 1)
- {
- for(new i= 1; i < MAX_ORG; i++)
- {
- if( IsPlayerInRangeOfPoint( playerid, 2.0, OI[ i ][ oPosExtX ], OI[ i ][ oPosExtY ], OI[ i ][ oPosExtZ ] ) )
- {
- SetPlayerPos( playerid, OI[ i ][ oPosIntX ], OI[ i ][ oPosIntY ], OI[ i ][ oPosIntZ ] );
- SetCameraBehindPlayer( playerid );
- SetPlayerInterior( playerid, OI[ i ][ oInt ]);
- SetPlayerVirtualWorld( playerid, OI[ i ][ oVw ]);
- }
- else if( IsPlayerInRangeOfPoint( playerid, 2.0, OI[ i ][ oPosIntX ], OI[ i ][ oPosIntY ], OI[ i ][ oPosIntZ ] ) && GetPlayerVirtualWorld(playerid) == OI[ i ][ oVw ] )
- {
- SetPlayerPos( playerid, OI[ i ][ oPosExtX ], OI[ i ][ oPosExtY ], OI[ i ][ oPosExtZ ] );
- SetCameraBehindPlayer( playerid );
- SetPlayerInterior( playerid, 0);
- SetPlayerVirtualWorld( playerid, 0);
- }
- }
- }
- }
- if( newkeys == KEY_SPRINT ) // Activate safe menu
- {
- new ime_string[128], OrgID = PI[ playerid ][ xMember ];
- format( ime_string, sizeof( ime_string ),"{FFFFFF}%s", OI[ OrgID ][ oName ] );
- if( OI[ OrgID ][ oSafe ] == 1 )
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.0, OI[ OrgID ][ oSafePosX ], OI[ OrgID ][ oSafePosY ], OI[ OrgID ][ oSafePosZ ] ) )
- {
- if( PI[ playerid ][ xMember ] != 0 )
- {
- ShowPlayerDialog( playerid, DIALOG_OSAFE, DIALOG_STYLE_LIST, ime_string, "Safe info\nTake materials\nPut materials\nTake money\nPut money\nTake drugs\nPut drugs", "Confirm", "Cancel" );
- }
- }
- }
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if( dialogid == DIALOG_ORGEDIT ) {
- if( listitem == 0 ) {
- ShowPlayerDialog(playerid, DIALOG_ORGNAME, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter ID and name of organization!", "Confirm", "Cancel" ); }
- if( listitem == 1 ) {
- ShowPlayerDialog( playerid, DIALOG_ORGINT1, DIALOG_STYLE_LIST, "Dimi Scripting", "Default Interior\nEnter your cordinates", "Confirm", "Cancel" ); }
- if( listitem == 2 ) {
- ShowPlayerDialog( playerid, DIALOG_ORGRANKS, DIALOG_STYLE_LIST, "Dimi Scripting", "Rank 1\nRank 2\nRank 3\nRank 4\nRank 5\nRank 6", "Confirm", "Cancel" ); }
- if( listitem == 3 ) {
- ShowPlayerDialog( playerid, DIALOG_ORGSKINS, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter IDs of skins for ranks of organization:\n There must be 6 IDs for each rank(rank1-6)\nExample: 54 29 31 45 123 121", "Confirm", "Cancel" ); }
- if( listitem == 4 ) {
- ShowPlayerDialog( playerid, DIALOG_ORGTYPE, DIALOG_STYLE_LIST, "Dimi Scripting", "Type: Legal organization\nType: Gang\nType: Mafia", "Confirm", "Cancel" ); }
- if( listitem == 5 ) {
- SendClientMessage( playerid, COLOR_ORANGE, "To change color of vehicles use '/orgcolor'" ); }
- if( listitem == 6 ) {
- SendClientMessage( playerid, COLOR_ORANGE, "To add vehicle for organization use '/orgvehicle'" ); }
- }
- if( dialogid == DIALOG_ORGRANKS ) {
- if(listitem == 0) {
- ShowPlayerDialog( playerid, DIALOG_ORGRANK1, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 1 of this organization.", "Confirm", "Cancel" ); }
- if(listitem == 1) {
- ShowPlayerDialog( playerid, DIALOG_ORGRANK2, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 2 of this organization.", "Confirm", "Cancel" ); }
- if(listitem == 2) {
- ShowPlayerDialog( playerid, DIALOG_ORGRANK3, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 3 of this organization.", "Confirm", "Cancel" ); }
- if(listitem == 3) {
- ShowPlayerDialog( playerid, DIALOG_ORGRANK4, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 4 of this organization.", "Confirm", "Cancel" ); }
- if(listitem == 4) {
- ShowPlayerDialog( playerid, DIALOG_ORGRANK5, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 5 of this organization.", "Confirm", "Cancel" ); }
- if(listitem == 5) {
- ShowPlayerDialog( playerid, DIALOG_ORGRANK6, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 6 of this organization.", "Confirm", "Cancel" ); }
- }
- if( dialogid == DIALOG_ORGNAME && response ) {
- new id, ime[ ORG_NAME ], ImaFajl[ 50 ];
- if(sscanf( inputtext, "is[128]", id, ime ) ) return ShowPlayerDialog(playerid, DIALOG_ORGNAME, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter ID and name of organization!", "Confirm", "Cancel");
- format( ImaFajl, sizeof( ImaFajl ), O_FILE, id );
- if( !fexist( ImaFajl ) ) return SendClientMessage(playerid, COLOR_RED, "That organization doesn't exist." );
- if( OrgCreate[ playerid ] == 0 ) {
- strmid(OI[id][oName], ime, 0, strlen(ime), ORG_NAME);
- SaveOrganization( id ) ; Orge3D( id );
- va_SendClientMessage( playerid, COLOR_GREEN, "Promenili ste ime organizacije(ID: %d ) u %s!", id, ime ); }
- }
- if( dialogid == DIALOG_ORGDELETE && response ) {
- new id, ImaFajl[50];
- if( !IsNumeric( inputtext ) ) return SendClientMessage( playerid, COLOR_RED, "Unesi samo ID orge!" );
- if(sscanf( inputtext, "i", id ) ) return ShowPlayerDialog( playerid, DIALOG_ORGDELETE, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter ID of organization u want to be deleted!", "Confirm", "Cancel" );
- format( ImaFajl, sizeof( ImaFajl ), O_FILE, id );
- if( !fexist( ImaFajl ) ) return SendClientMessage(playerid, COLOR_RED, "That organization doesn't exist." );
- Delete3DTextLabel( Org3D[id] );
- DestroyPickup( OrgPickup[id] );
- new string[ 128 ];
- format( string, sizeof( string ), O_FILE, id );
- fremove( string );
- va_SendClientMessage( playerid, COLOR_GREEN, "Successfully deleted organization id %d.", id );
- }
- if( dialogid == DIALOG_ORGSCREATE && response ) {
- new id, ImaFajl[50], Float:PozX, Float:PozY, Float:PozZ;
- GetPlayerPos( playerid, PozX, PozY, PozZ );
- if(sscanf( inputtext, "i", id ) ) return ShowPlayerDialog(playerid, DIALOG_ORGSCREATE, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter ID of organization which make the safe.", "Confirm", "Cancel");
- format( ImaFajl, sizeof( ImaFajl ), O_FILE, id );
- if( !fexist( ImaFajl ) ) return SendClientMessage(playerid, COLOR_RED, "That organization doesn't exist." );
- if( OI[ id ][ oSafe ] == 1 ) return SendClientMessage(playerid, COLOR_RED, "That organization already have safe." );
- OI[ id ][ oSafePosX ] = PozX; OI[ id ][ oSafePosY ] = PozY; OI[ id ][ oSafePosZ ] = PozZ;
- OI[ id ][ oSafe ] = 1; OI[ id ][ oSafeDrugs ] = 0; OI[ id ][ oSafeMats ] = 0; OI[ id ][ oSafeMoney ] = 0;
- SaveOrganization( id );
- SendClientMessage( playerid, COLOR_GREEN, "Successfully created safe for organization." );
- OrgSafeLabel[ id ] = Create3DTextLabel( "{FF6200}Press {FFFFFF}'SPACE' {FF6200}to open safe menu{FF6200}" ,COLOR_GREEN, OI[ id ][ oSafePosX ], OI[ id ][ oSafePosY ], OI[ id ][ oSafePosZ ], 25, OI[ id ][ oVw ], 1);
- OrgSafePickup[ id ] = CreateDynamicPickup( 1239, 1, OI[ id ][ oSafePosX ], OI[ id ][ oSafePosY ], OI[ id ][ oSafePosZ ], OI[ id ][ oVw ] );
- Orge3D( id );
- }
- if( dialogid == DIALOG_ORGCREATE && response ) {
- new ime[ ORG_NAME ], fileorge[ 40 ], string[512], Float:PozX, Float:PozY, Float:PozZ;
- GetPlayerPos( playerid, PozX, PozY, PozZ );
- if(sscanf( inputtext, "s[128]", ime ) ) return ShowPlayerDialog(playerid, DIALOG_ORGCREATE, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter the name of organization!", "Confirm", "Cancel");
- for( new id = 1; id < MAX_ORG; id++ ) {
- format(fileorge, sizeof( fileorge ), O_FILE, id);
- if( !fexist( fileorge ) ) {
- strmid(OI[id][oName], ime, 0, strlen(ime), ORG_NAME);
- OI[id][oID] = id;
- strmid(OI[id][oLeader], "No-one", 0, strlen("No-one"), ORG_LEADER);
- strmid(OI[id][oMember1], "No-one", 0, strlen("No-one"), ORG_MEMBER);
- strmid(OI[id][oMember2], "No-one", 0, strlen("No-one"), ORG_MEMBER);
- strmid(OI[id][oMember3], "No-one", 0, strlen("No-one"), ORG_MEMBER);
- strmid(OI[id][oMember4], "No-one", 0, strlen("No-one"), ORG_MEMBER);
- strmid(OI[id][oMember5], "No-one", 0, strlen("No-one"), ORG_MEMBER);
- strmid(OI[id][oMember6], "No-one", 0, strlen("No-one"), ORG_MEMBER);
- strmid(OI[id][oMember7], "No-one", 0, strlen("No-one"), ORG_MEMBER);
- strmid(OI[id][oMember8], "No-one", 0, strlen("No-one"), ORG_MEMBER);
- strmid(OI[id][oMember9], "No-one", 0, strlen("No-one"), ORG_MEMBER);
- strmid(OI[id][oMember10], "No-one", 0, strlen("No-one"), ORG_MEMBER);
- strmid(OI[id][oMember11], "No-one", 0, strlen("No-one"), ORG_MEMBER);
- strmid(OI[id][oMember12], "No-one", 0, strlen("No-one"), ORG_MEMBER);
- OI[id][oColor_1] = -1; OI[id][oColor_2] = -1;
- OI[id][oPosExtX] = PozX; OI[id][oPosExtY] = PozY; OI[id][oPosExtZ] = PozZ;
- OI[ id ][ oSafePosX ] = 0; OI[ id ][ oSafePosY ] = 0; OI[ id ][ oSafePosZ ] = 0;
- OI[ id ][ oSafe ] = 0; OI[ id ][ oSafeDrugs ] = 0; OI[ id ][ oSafeMats ] = 0; OI[ id ][ oSafeMoney ] = 0;
- OrgCreate[ playerid ] = id;
- SaveOrganization( id) ;
- format(string,sizeof(string),"{FFFFFF}%s\n{FF6200}Leader: {FFFFFF}%s\n{FF6200}For entrance click\n{FFFFFF}'ENTER'", OI[ id ][ oName ], OI[ id ][ oLeader ] );
- Org3D[ id ] = Create3DTextLabel(string , COLOR_GREEN, PozX, PozY, PozZ, 25, 0, 1);
- OrgPickup[ id ] = CreateDynamicPickup(1314, 1, PozX, PozY, PozZ);
- ShowPlayerDialog( playerid, DIALOG_ORGINT1, DIALOG_STYLE_LIST, "Dimi Scripting", "Default Interior\nEnter your cordinates", "Confirm", "Cancel" );
- break; } }
- }
- if(dialogid == DIALOG_ORGINT1 && response) {
- new id = IsPlayerNearOrganization(playerid);
- if( listitem == 0 ) {
- if( OrgCreate[ playerid ] == 0 ) {
- OI[ id ][ oPosIntX ] = 246.7840;
- OI[ id ][ oPosIntY ] = 63.9002;
- OI[ id ][ oPosIntZ ] = 1003.6406;
- OI[ id ][ oInt ] = 6;
- OI[ id ][ oVw ] = id;
- SaveOrganization( id ); SendClientMessage( playerid, COLOR_GREEN, "Successfully maked default interior!" ); }
- else {
- OI[ id ][ oPosIntX ] = 246.7840;
- OI[ id ][ oPosIntY ] = 63.9002;
- OI[ id ][ oPosIntZ ] = 1003.6406;
- OI[ id ][ oInt ] = 6;
- OI[ id ][ oVw ] = id;
- SaveOrganization( id );
- ShowPlayerDialog( playerid, DIALOG_ORGTYPE, DIALOG_STYLE_LIST, "Dimi Scripting", "Type: Legal organization\nType: Gang\nType: Mafia", "Confirm", "Cancel" ); } }
- if( listitem == 1 ) {
- ShowPlayerDialog( playerid, DIALOG_ORGINT2, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter cordinates of interior and ID of interior\n Example: 246.7840 63.9002 1003.6406 6", "Confirm", "Cancel" ); }
- }
- if(dialogid == DIALOG_ORGINT2 && response) {
- new id = IsPlayerNearOrganization(playerid);
- new Float:Poz[3];
- new intid;
- if(sscanf(inputtext, "fffi", Poz[0],Poz[1],Poz[2],intid)) return ShowPlayerDialog(playerid, DIALOG_ORGINT2, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter cordinates of interior and ID of interior\n Example: 246.7840 63.9002 1003.6406 6", "Confirm", "Cancel" );
- if( OrgCreate[ playerid ] == 0 ) {
- OI[ id ][ oPosIntX ] = Poz[0];
- OI[ id ][ oPosIntY ] = Poz[1];
- OI[ id ][ oPosIntZ ] = Poz[2];
- OI[ id ][ oInt ] = intid;
- OI[ id ][ oVw ] = id;
- SaveOrganization( id ); SendClientMessage( playerid, COLOR_RED, "Successfully changed interior!" ); }
- else {
- OI[ id ][ oPosIntX ] = Poz[0];
- OI[ id ][ oPosIntY ] = Poz[1];
- OI[ id ][ oPosIntZ ] = Poz[2];
- OI[ id ][ oInt ] = intid;
- OI[ id ][ oVw ] = id;
- SaveOrganization( id );
- ShowPlayerDialog( playerid, DIALOG_ORGTYPE, DIALOG_STYLE_LIST, "Dimi Scripting", "Type: Legal organization\nType: Gang\nType: Mafia", "Confirm", "Cancel" ); }
- }
- if(dialogid == DIALOG_ORGTYPE && response) {
- new id = IsPlayerNearOrganization(playerid);
- if( OrgCreate[ playerid ] == 0 ) {
- if(listitem == 0) {
- OI[ id ][ oType ] = 1;
- SaveOrganization( id );
- SendClientMessage(playerid, COLOR_GREEN, "Type : Legal organization" ); }
- if(listitem == 1) {
- OI[ id][ oType ] = 2;
- SaveOrganization( id );
- SendClientMessage(playerid, COLOR_GREEN, "Type : Gang" ); }
- if(listitem == 2) {
- OI[ id ][ oType ] = 3;
- SaveOrganization( id );
- SendClientMessage(playerid, COLOR_GREEN, "Type : Mafia" ); } }
- else {
- if(listitem == 0) {
- OI[ id ][ oType ] = 1;
- SaveOrganization( id );
- SendClientMessage(playerid, COLOR_GREEN, "Type : Legal organization" ); }
- if(listitem == 1) {
- OI[ id][ oType ] = 2;
- SaveOrganization( id );
- SendClientMessage(playerid, COLOR_GREEN, "Type : Gang" ); }
- if(listitem == 2) {
- OI[ id ][ oType ] = 3;
- SaveOrganization( id );
- SendClientMessage(playerid, COLOR_GREEN, "Type : Mafia" ); }
- ShowPlayerDialog(playerid, DIALOG_ORGSKINS, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter IDs of skins for ranks of organization:\n There must be 6 IDs for each rank(rank1-6)\nExample: 54 29 31 45 123 121", "Confirm", "Cancel"); }
- return 1;
- }
- if(dialogid == DIALOG_ORGSKINS && response) {
- new id = IsPlayerNearOrganization(playerid);
- new rank1, rank2, rank3, rank4, rank5, rank6;
- if(sscanf(inputtext, "iiiiii", rank1, rank2, rank3, rank4, rank5, rank6)) return ShowPlayerDialog(playerid, DIALOG_ORGSKINS, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter IDs of skins for ranks of organization:\n There must be 6 IDs for each rank(rank1-6)\nExample: 54 29 31 45 123 121", "Confirm", "Cancel" );
- if( OrgCreate[ playerid ] == 0 ) {
- OI[ id ][ oSkin1 ] = rank1;
- OI[ id ][ oSkin2 ] = rank2;
- OI[ id ][ oSkin3 ] = rank3;
- OI[ id ][ oSkin4 ] = rank4;
- OI[ id ][ oSkin5 ] = rank5;
- OI[ id ][ oSkin6 ] = rank6;
- SaveOrganization( id ); SendClientMessage( playerid, COLOR_GREEN, "Successfully changed IDs of skins for ranks." ); }
- else {
- OI[ id ][ oSkin1 ] = rank1;
- OI[ id ][ oSkin2 ] = rank2;
- OI[ id ][ oSkin3 ] = rank3;
- OI[ id ][ oSkin4 ] = rank4;
- OI[ id ][ oSkin5 ] = rank5;
- OI[ id ][ oSkin6 ] = rank6;
- SaveOrganization( id );
- ShowPlayerDialog( playerid, DIALOG_ORGRANK1, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 1 of this organization.", "Confirm", "Cancel" ); }
- }
- if(dialogid == DIALOG_ORGRANK1) {
- new id = IsPlayerNearOrganization(playerid);
- new ime[ORG_RANK];
- if(sscanf(inputtext, "s[64]", ime)) return ShowPlayerDialog(playerid, DIALOG_ORGRANK1, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 1 of this organization.", "Confirm", "Cancel" );
- if( OrgCreate[ playerid ] == 0 ) {
- strmid( OI[ id ][ oRank1 ], ime, 0, strlen(ime), ORG_RANK);
- SaveOrganization(id);
- va_SendClientMessage( playerid, COLOR_GREEN, "The name of this rank is %s", OI[ id ][ oRank1 ] ); }
- else {
- strmid( OI[ id ][ oRank1 ], ime, 0, strlen(ime), ORG_RANK);
- SaveOrganization(id);
- va_SendClientMessage( playerid, COLOR_GREEN, "The name of this rank is %s", OI[ id ][ oRank1 ] );
- ShowPlayerDialog( playerid, DIALOG_ORGRANK2, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 2 of this organization.", "Confirm", "Cancel" ); }
- }
- if(dialogid == DIALOG_ORGRANK2) {
- new id = IsPlayerNearOrganization(playerid);
- new ime[ORG_RANK];
- if(sscanf(inputtext, "s[64]", ime)) return ShowPlayerDialog(playerid, DIALOG_ORGRANK2, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 2 of this organization.", "Confirm", "Cancel" );
- if( OrgCreate[ playerid ] == 0 ) {
- strmid( OI[ id ][ oRank2 ], ime, 0, strlen(ime), ORG_RANK);
- SaveOrganization(id);
- va_SendClientMessage(playerid, COLOR_GREEN, "The name of this rank is %s", OI[ id ][ oRank2 ]); }
- else {
- strmid( OI[ id ][ oRank2 ], ime, 0, strlen(ime), ORG_RANK);
- SaveOrganization(id);
- va_SendClientMessage(playerid, COLOR_GREEN, "The name of this rank is %s", OI[ id ][ oRank2 ]);
- ShowPlayerDialog(playerid, DIALOG_ORGRANK3, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 3 of this organization.", "Confirm", "Cancel"); }
- }
- if(dialogid == DIALOG_ORGRANK3) {
- new id = IsPlayerNearOrganization(playerid);
- new ime[ORG_RANK];
- if(sscanf(inputtext, "s[64]", ime)) return ShowPlayerDialog(playerid, DIALOG_ORGRANK3, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 3 of this organization.", "Confirm", "Cancel" );
- if( OrgCreate[ playerid ] == 0 ) {
- strmid(OI[ id ][ oRank3 ], ime, 0, strlen(ime), ORG_RANK);
- SaveOrganization(id);
- va_SendClientMessage(playerid, COLOR_GREEN, "The name of this rank is %s", OI[ id ][ oRank3 ]); }
- else {
- strmid(OI[ id ][ oRank3 ], ime, 0, strlen(ime), ORG_RANK);
- SaveOrganization(id);
- va_SendClientMessage(playerid, COLOR_GREEN, "The name of this rank is %s", OI[ id ][ oRank3 ]);
- ShowPlayerDialog(playerid, DIALOG_ORGRANK4, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 4 of this organization.", "Confirm", "Cancel" ); }
- }
- if(dialogid == DIALOG_ORGRANK4) {
- new id = IsPlayerNearOrganization(playerid);
- new ime[ORG_RANK];
- if(sscanf(inputtext, "s[64]", ime)) return ShowPlayerDialog(playerid, DIALOG_ORGRANK4, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 4 of this organization.", "Confirm", "Cancel" );
- if( OrgCreate[ playerid ] == 0 ) {
- strmid( OI[ id][ oRank4 ], ime, 0, strlen(ime), ORG_RANK);
- SaveOrganization(id);
- va_SendClientMessage(playerid, COLOR_GREEN, "The name of this rank is %s", OI[id][ oRank4 ]); }
- else {
- strmid( OI[ id][ oRank4 ], ime, 0, strlen(ime), ORG_RANK);
- SaveOrganization(id);
- va_SendClientMessage(playerid, COLOR_GREEN, "The name of this rank is %s", OI[id][ oRank4 ]);
- ShowPlayerDialog(playerid, DIALOG_ORGRANK5, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 5 of this organization.", "Confirm", "Cancel" ); }
- }
- if(dialogid == DIALOG_ORGRANK5) {
- new id = IsPlayerNearOrganization(playerid);
- new ime[ORG_RANK];
- if(sscanf(inputtext, "s[64]", ime)) return ShowPlayerDialog(playerid, DIALOG_ORGRANK5, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 5 of this organization.", "Confirm", "Cancel" );
- if( OrgCreate[ playerid ] == 0 ) {
- strmid( OI[ id ][ oRank5 ], ime, 0, strlen(ime), ORG_RANK);
- SaveOrganization(id);
- va_SendClientMessage(playerid, COLOR_GREEN, "The name of this rank is %s", OI[ id ][ oRank5 ]); }
- else {
- strmid( OI[ id ][ oRank5 ], ime, 0, strlen(ime), ORG_RANK);
- SaveOrganization(id);
- va_SendClientMessage(playerid, COLOR_GREEN, "The name of this rank is %s", OI[ id ][ oRank5 ]);
- ShowPlayerDialog(playerid, DIALOG_ORGRANK6, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 6 of this organization.", "Confirm", "Cancel" ); }
- }
- if(dialogid == DIALOG_ORGRANK6) {
- new id = IsPlayerNearOrganization(playerid);
- new ime[ORG_RANK];
- if( sscanf( inputtext, "s[64]", ime ) ) return ShowPlayerDialog( playerid, DIALOG_ORGRANK6, DIALOG_STYLE_INPUT, "Dimi Scripting", "In empty space enter name for rank 6 of this organization.", "Confirm", "Cancel" );
- strmid( OI[ id ][ oRank6 ], ime, 0, strlen(ime), ORG_RANK);
- SaveOrganization( id );
- va_SendClientMessage( playerid, COLOR_GREEN, "The name of this rank is %s", OI[ id ][ oRank6 ] );
- OrgCreate[ playerid ] = 0;
- }
- if( dialogid == DIALOG_LEADER && response ) {
- switch(listitem) {
- case 0: {
- ShowPlayerDialog(playerid, DIALOG_INVITE, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter ID of player who want invite.", "Confirm", "Cancel"); }
- case 1: {
- ShowPlayerDialog(playerid, DIALOG_UNINVITE, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter ID of player who want uninvite.", "Confirm", "Cancel"); }
- case 2: {
- ShowPlayerDialog(playerid, DIALOG_GIVERANK, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter ID of player and number of rank which u want give to player.", "Confirm", "Cancel"); }
- case 3: {
- new cla_string[ 512 ], OrgID = PI[ playerid ][ xLeader ];
- format( cla_string, sizeof( cla_string ), "Leader: %s\nMember 1: %s\nMember 2: %s\nMember 3: %s\nMember 4: %s\nMember 5: %s\nMember 6: %s\nMember 7: %s\nMember 8: %s\nMember 9: %s\nMember 10: %s\nMember 11: %s\nMember 12: %s" ,
- OI[ OrgID ][ oLeader ],
- OI[ OrgID ][ oMember1 ],
- OI[ OrgID ][ oMember2 ],
- OI[ OrgID ][ oMember3 ],
- OI[ OrgID ][ oMember4 ],
- OI[ OrgID ][ oMember5 ],
- OI[ OrgID ][ oMember6 ],
- OI[ OrgID ][ oMember7 ],
- OI[ OrgID ][ oMember8 ],
- OI[ OrgID ][ oMember9 ],
- OI[ OrgID ][ oMember10 ],
- OI[ OrgID ][ oMember11 ],
- OI[ OrgID ][ oMember12 ] );
- ShowPlayerDialog(playerid, DIALOG_ALLMEMBERS, DIALOG_STYLE_MSGBOX, "Dimi Scripting", cla_string, "Confirm", "Cancel"); } }
- }
- if( dialogid == DIALOG_INVITE && response ) {
- new igrac;
- if( sscanf( inputtext, "u", igrac ) ) return SendClientMessage( playerid, COLOR_RED, "Irregural ID" );
- if( igrac == INVALID_PLAYER_ID ) return SendClientMessage( playerid, COLOR_RED, "Player is offline or wrong ID!" );
- if( PI[ igrac ][ xMember ] != 0 ) return SendClientMessage( playerid, COLOR_RED, "Player is already member of some organization!" );
- if( PI[ igrac ][ xLeader ] != 0 ) return SendClientMessage( playerid, COLOR_RED, "Player is already member of some organization!" );
- if( PI[ igrac ][ xLevel ] < 2 ) return SendClientMessage( playerid, COLOR_RED, "Level of this player is less then 2!" );
- new OrgID = PI[ playerid ][ xLeader ], ime[ MAX_PLAYER_NAME ];
- GetPlayerName(igrac, ime, sizeof ime);
- if( !strcmp( OI[ OrgID ][ oMember1 ], "No-one", true ) ) { strmid( OI[ OrgID ][ oMember1 ], ime, 0, strlen(ime), 255); }
- else if( !strcmp( OI[ OrgID ][ oMember2 ], "No-one", true ) ) { strmid( OI[ OrgID ][ oMember2 ], ime, 0, strlen(ime), 255); }
- else if( !strcmp( OI[ OrgID ][ oMember3 ], "No-one", true ) ) { strmid( OI[ OrgID ][ oMember3 ], ime, 0, strlen(ime), 255); }
- else if( !strcmp( OI[ OrgID ][ oMember4 ], "No-one", true ) ) { strmid( OI[ OrgID ][ oMember4 ], ime, 0, strlen(ime), 255); }
- else if( !strcmp( OI[ OrgID ][ oMember5 ], "No-one", true ) ) { strmid( OI[ OrgID ][ oMember5 ], ime, 0, strlen(ime), 255); }
- else if( !strcmp( OI[ OrgID ][ oMember6 ], "No-one", true ) ) { strmid( OI[ OrgID ][ oMember6 ], ime, 0, strlen(ime), 255); }
- else if( !strcmp( OI[ OrgID ][ oMember7 ], "No-one", true ) ) { strmid( OI[ OrgID ][ oMember7 ], ime, 0, strlen(ime), 255); }
- else if( !strcmp( OI[ OrgID ][ oMember8 ], "No-one", true ) ) { strmid( OI[ OrgID ][ oMember8 ], ime, 0, strlen(ime), 255); }
- else if( !strcmp( OI[ OrgID ][ oMember9 ], "No-one", true ) ) { strmid( OI[ OrgID ][ oMember9 ], ime, 0, strlen(ime), 255); }
- else if( !strcmp( OI[ OrgID ][ oMember10 ], "No-one", true ) ) { strmid( OI[ OrgID ][ oMember10 ], ime, 0, strlen(ime), 255); }
- else if( !strcmp( OI[ OrgID ][ oMember11 ], "No-one", true ) ) { strmid( OI[ OrgID ][ oMember11 ], ime, 0, strlen(ime), 255); }
- else if( !strcmp( OI[ OrgID ][ oMember12 ], "No-one", true ) ) { strmid( OI[ OrgID ][ oMember12 ], ime, 0, strlen(ime), 255); }
- else { SendClientMessage( playerid, COLOR_RED,"You have a maximum members in your organization!" ); return true; }
- PI[ igrac ][ xMember ] = OrgID; PI[ igrac ][ xRank ] = 1;
- PI[ igrac ][ xSkin ] = OI[ OrgID ][ oSkin1 ];
- SetPlayerSkin( igrac, OI[ OrgID ][ oSkin1 ] );
- SaveOrganization( OrgID );
- va_SendClientMessage(igrac, COLOR_GREEN, "Congratulations, you enter in organization %s, by leader %s.", OI[ OrgID ][ oName ], OI[ OrgID ][ oLeader ] );
- va_SendClientMessage(playerid, COLOR_GREEN, "You invite %s in your organization.", ime);
- }
- if( dialogid == DIALOG_UNINVITE && response ) {
- new igrac, OrgID = PI[ playerid ][ xLeader ];
- if( sscanf( inputtext, "u", igrac ) ) return SendClientMessage( playerid, COLOR_RED, "Irregural ID!" );
- if( igrac == INVALID_PLAYER_ID ) return SendClientMessage( playerid, COLOR_RED, "Player is offline or wrong ID!" );
- if( PI[ igrac ][ xMember ] != OrgID ) return SendClientMessage( playerid, COLOR_RED, "Player is not a member of your organization!" );
- if( strcmp( PlayerName(igrac), OI[ OrgID ][ oMember1 ], true ) == 0) { strmid( OI[ OrgID ][ oMember1], "No-one", 0, strlen("No-one"), 255); }
- else if( strcmp( PlayerName(igrac), OI[ OrgID ][ oMember2 ], true ) == 0) { strmid( OI[ OrgID ][ oMember2 ], "No-one", 0, strlen("No-one"), 255 ); }
- else if( strcmp( PlayerName(igrac), OI[ OrgID ][ oMember3 ], true ) == 0) { strmid( OI[ OrgID ][ oMember3 ], "No-one", 0, strlen("No-one"), 255 ); }
- else if( strcmp( PlayerName(igrac), OI[ OrgID ][ oMember4 ], true ) == 0) { strmid( OI[ OrgID ][ oMember4 ], "No-one", 0, strlen("No-one"), 255 ); }
- else if( strcmp( PlayerName(igrac), OI[ OrgID ][ oMember5 ], true ) == 0) { strmid( OI[ OrgID ][ oMember5 ], "No-one", 0, strlen("No-one"), 255 ); }
- else if( strcmp( PlayerName(igrac), OI[ OrgID ][ oMember6 ], true ) == 0) { strmid( OI[ OrgID ][ oMember6 ], "No-one", 0, strlen("No-one"), 255 ); }
- else if( strcmp( PlayerName(igrac), OI[ OrgID ][ oMember7 ], true ) == 0) { strmid( OI[ OrgID ][ oMember7 ], "No-one", 0, strlen("No-one"), 255 ); }
- else if( strcmp( PlayerName(igrac), OI[ OrgID ][ oMember8 ], true ) == 0) { strmid( OI[ OrgID ][ oMember8 ], "No-one", 0, strlen("No-one"), 255 ); }
- else if( strcmp( PlayerName(igrac), OI[ OrgID ][ oMember9 ], true ) == 0) { strmid( OI[ OrgID ][ oMember9 ], "No-one", 0, strlen("No-one"), 255 ); }
- else if( strcmp( PlayerName(igrac), OI[ OrgID ][ oMember10 ], true ) == 0) { strmid( OI[ OrgID ][ oMember10 ], "No-one", 0, strlen("No-one"), 255 ); }
- else if( strcmp( PlayerName(igrac), OI[ OrgID ][ oMember11 ], true ) == 0) { strmid( OI[ OrgID ][ oMember11 ], "No-one", 0, strlen("No-one"), 255 ); }
- else if( strcmp( PlayerName(igrac), OI[ OrgID ][ oMember12 ], true ) == 0) { strmid( OI[ OrgID ][ oMember12 ], "No-one", 0, strlen("No-one"), 255 ); }
- else { SendClientMessage( playerid, COLOR_RED, "lalala!" ); return true; }
- PI[ igrac ][ xMember ] = 0; PI[ igrac ][ xRank ] = 0; PI[ igrac ][ xSkin ] = 5;
- SetPlayerSkin( igrac, 5 );
- SaveOrganization( OrgID );
- va_SendClientMessage(igrac, COLOR_RED, "You are uninvite from organization %s.", OI[ OrgID ][ oName ]);
- va_SendClientMessage(playerid, COLOR_RED, "You uninvite %s from your organization.", PlayerName(igrac));
- }
- if( dialogid == DIALOG_GIVERANK && response ) {
- new member, OrgID = PI[ playerid ][ xLeader ], rank;
- if( sscanf( inputtext, "ui", member, rank ) ) return ShowPlayerDialog(playerid, DIALOG_GIVERANK, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter ID of player and number of rank which u want give to player.", "Confirm", "Cancel");
- if( rank < 1 || rank > 5) return SendClientMessage( playerid, COLOR_RED, "Rank can't be bigger then 5 and lower then 1.!" );
- if( member == INVALID_PLAYER_ID ) return SendClientMessage( playerid, COLOR_RED, "Player is offline or wrong ID!" );
- if( PI[ member ][ xMember ] != OrgID ) return SendClientMessage( playerid, COLOR_RED, "Player is not a member of your organization." );
- if( rank == 1 ) { PI[ member ][ xSkin ] = OI[ OrgID ][ oSkin1 ]; SetPlayerSkin( member, OI[ OrgID ][ oSkin1 ] ); }
- else if( rank == 2 ) { PI[ member ][ xSkin ] = OI[ OrgID ][ oSkin2 ]; SetPlayerSkin( member, OI[ OrgID ][ oSkin2 ] ); }
- else if( rank == 3 ) { PI[ member ][ xSkin ] = OI[ OrgID ][ oSkin3 ]; SetPlayerSkin( member, OI[ OrgID ][ oSkin3 ] ); }
- else if( rank == 4 ) { PI[ member ][ xSkin ] = OI[ OrgID ][ oSkin4 ]; SetPlayerSkin( member, OI[ OrgID ][ oSkin4 ] ); }
- else if( rank == 5 ) { PI[ member ][ xSkin ] = OI[ OrgID ][ oSkin5 ]; SetPlayerSkin( member, OI[ OrgID ][ oSkin5 ] ); }
- else { return true; }
- PI[ member ][ xRank ] = rank;
- va_SendClientMessage( member, COLOR_GREEN, "Lider give u rank %d!", rank );
- va_SendClientMessage( playerid, COLOR_GREEN, "U give rank %d to player %s!", PlayerName( member ), rank );
- }
- if( dialogid == DIALOG_OSAFE ) {
- if( !response ) return true;
- new string[ 256 ], OrgID = PI[ playerid ][ xMember ];
- switch(listitem) {
- case 0: {
- format(string,sizeof(string),"{FFFFFF}%s {FF6200}Sef information\n\n{FF6200}Materials: {FFFFFF}%d\n{FF6200}Money: {FFFFFF}%d$\n{FF6200}Drugs: {FFFFFF}%d", OI[ OrgID ][ oName ], OI[ OrgID ][ oSafeMats ], OI[ OrgID ][ oSafeMoney ], OI[ OrgID ][ oSafeDrugs ] );
- ShowPlayerDialog( playerid, DIALOG_SAFE_INFO, DIALOG_STYLE_MSGBOX, "Dimi Scripting", string, "Confirm", "Cancel" ); }
- case 1: {
- if( PI[ playerid ][ xLeader ] == 0) return SendClientMessage( playerid, COLOR_RED, "Only leader can take from safe!" );
- ShowPlayerDialog( playerid, DIALOG_SAFE_TMATS, DIALOG_STYLE_INPUT , "Dimi Scripting", "Enter the amount of materials which u want take.", "Take", "Cancel" ); }
- case 2: {
- ShowPlayerDialog( playerid, DIALOG_SAFE_PMATS, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter the amount of materials which u want put", "Put", "Cancel" ); }
- case 3: {
- if( PI[ playerid ][ xLeader ] == 0) return SendClientMessage( playerid, COLOR_RED, "Only leader can take from safe!" );
- ShowPlayerDialog( playerid, DIALOG_SAFE_TMONEY, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter the amount of money which u want take", "Take", "Cancel" ); }
- case 4: {
- ShowPlayerDialog( playerid, DIALOG_SAFE_DMONEY, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter the amount of money which u want put.", "Put", "Cancel" ); }
- case 5: {
- if( PI[ playerid ][ xLeader ] == 0) return SendClientMessage( playerid, COLOR_RED, "Only leader can take from safe!" );
- ShowPlayerDialog( playerid, DIALOG_SAFE_TDRUGS, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter the amount of drugs which u want take.", "Take", "Cancel" ); }
- case 6: {
- ShowPlayerDialog( playerid, DIALOG_SAFE_PDRUGS, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter the amount of drugs which u want put.", "Put", "Cancel" ); } }
- }
- if( dialogid == DIALOG_SAFE_TMATS ) {
- if( !response ) return true;
- if( response ) {
- new iznos, string[ 256 ], OrgID = PI[ playerid ][ xMember ];
- if( sscanf( inputtext, "i", iznos ) ) return SendClientMessage( playerid, COLOR_RED, "You did not enter amount of materials.!" );
- if( iznos < 1 || iznos > 10000 ) return SendClientMessage( playerid, COLOR_RED, "Amount of materials can't be lower then 1 and bigger then 10000." );
- if( iznos > OI[ OrgID ][ oSafeMats ] ) return SendClientMessage( playerid, COLOR_RED, "No such materials in a safe!" );
- PI[ playerid ][ xMats ] += iznos; OI[ OrgID ][ oSafeMats ] -= iznos; SaveOrganization( OrgID );
- va_SendClientMessage( playerid, COLOR_GREEN,"You take %d materials from safe.!", iznos );
- format(string, sizeof(string), "* %s take some things from safe.", PlayerName( playerid ) );
- ProxDetector( 20.0, playerid ,string,COLOR_PURPLE ); }
- }
- if( dialogid == DIALOG_SAFE_PMATS ) {
- if( !response ) return true;
- if( response ) {
- new iznos, string[ 256 ], OrgID = PI[ playerid ][ xMember ];
- if( sscanf( inputtext, "i", iznos ) ) return SendClientMessage( playerid, COLOR_RED, "You did not enter amount of materials!" );
- if( iznos < 1 || iznos > 10000 ) return SendClientMessage( playerid, COLOR_RED, "Amount of materials can't be lower then 1 and bigger then 10000." );
- if( iznos > PI[ playerid ][ xMats ] ) return SendClientMessage( playerid, COLOR_RED, "No such materials with you!" );
- PI[ playerid ][ xMats ] -= iznos; OI[ OrgID ][ oSafeMats ] += iznos; SaveOrganization( OrgID );
- va_SendClientMessage( playerid, COLOR_GREEN,"You put %d materials in safe!", iznos );
- format(string, sizeof(string), "* %s put some things in safe.", PlayerName( playerid ) );
- ProxDetector( 20.0, playerid ,string,COLOR_PURPLE ); }
- }
- if( dialogid == DIALOG_SAFE_TDRUGS ) {
- if( !response ) return true;
- if( response ) {
- new iznos, string[ 256 ], OrgID = PI[ playerid ][ xMember ];
- if( sscanf( inputtext, "i", iznos ) ) return SendClientMessage( playerid, COLOR_RED, "You did not enter amount of drugs!" );
- if( iznos < 1 || iznos > 10000 ) return SendClientMessage( playerid, COLOR_RED, "Amount of drugs can't be lower then 1 and bigger then 10000." );
- if( iznos > OI[ OrgID ][ oSafeDrugs ] ) return SendClientMessage( playerid, COLOR_RED, "No such drugs in a safe!" );
- PI[ playerid ][ xDrugs ] += iznos; OI[ OrgID ][ oSafeDrugs ] -= iznos; SaveOrganization( OrgID );
- va_SendClientMessage( playerid, COLOR_GREEN,"You take %dg drugs from safe.!", iznos );
- format(string, sizeof(string), "* %s take some things from safe.", PlayerName( playerid ) );
- ProxDetector( 20.0, playerid ,string,COLOR_PURPLE ); }
- }
- if( dialogid == DIALOG_SAFE_PDRUGS ) {
- if( !response ) return true;
- if( response ) {
- new iznos, string[ 256 ], OrgID = PI[ playerid ][ xMember ];
- if( sscanf( inputtext, "i", iznos ) ) return SendClientMessage( playerid, COLOR_RED, "You did not enter amount of drugs!" );
- if( iznos < 1 || iznos > 10000 ) return SendClientMessage( playerid, COLOR_RED, "Amount of drugs can't be lower then 1 and bigger then 10000." );
- if( iznos > PI[ playerid ][ xDrugs ] ) return SendClientMessage( playerid, COLOR_RED, "No such drugs with you!" );
- PI[ playerid ][ xDrugs ] -= iznos; OI[ OrgID ][ oSafeDrugs ] += iznos; SaveOrganization( OrgID );
- va_SendClientMessage( playerid, COLOR_GREEN,"You put %dg drugs in safe!", iznos );
- format(string, sizeof(string), "* %s put some things in safe.", PlayerName( playerid ) );
- ProxDetector( 20.0, playerid ,string,COLOR_PURPLE ); }
- }
- if(dialogid == DIALOG_SAFE_TMONEY)
- {
- if(!response) return true;
- if(response)
- {
- new iznos,string[256], OrgID = PI[ playerid ][ xMember ];
- if(sscanf(inputtext, "i", iznos)) return SendClientMessage( playerid, COLOR_RED, "You did not enter amount of money!");
- if(iznos < 1 || iznos > 10000) return SendClientMessage( playerid, COLOR_RED, "Amount of money can't be lower then 1 and bigger then 10000.");
- if(iznos > OI[ OrgID ][ oSafeMoney ]) return SendClientMessage( playerid, COLOR_RED, "No such money in a safe!");
- GivePlayerMoney(playerid, iznos); OI[ OrgID ][ oSafeMoney ] -= iznos; SaveOrganization( OrgID );
- va_SendClientMessage( playerid, COLOR_GREEN, "You take %d$ money from safe.!",iznos);
- format(string, sizeof(string), "* %s take some things from safe.", PlayerName(playerid));
- ProxDetector(20.0,playerid,string,COLOR_PURPLE ); }
- }
- if(dialogid == DIALOG_SAFE_DMONEY)
- {
- if( !response ) return true;
- if( response )
- {
- new iznos,string[256], OrgID = PI[ playerid ][ xMember ];
- if(sscanf(inputtext, "i", iznos)) return SendClientMessage( playerid, COLOR_RED, "You did not enter amount of money!");
- if(iznos < 1 || iznos > 10000) return SendClientMessage( playerid, COLOR_RED, "Amount of money can't be lower then 1 and bigger then 10000.");
- if(iznos > GetPlayerMoney(playerid)) return SendClientMessage( playerid, COLOR_RED, "No such money with you!");
- GivePlayerMoney(playerid, -iznos); OI[ OrgID ][ oSafeMoney ] += iznos; SaveOrganization( OrgID );
- va_SendClientMessage( playerid, COLOR_GREEN, "You put %d$ money in safe!",iznos);
- format(string, sizeof(string), "* %s put some things in safe.", PlayerName(playerid));
- ProxDetector(20.0,playerid,string,COLOR_PURPLE ); }
- }
- return 1;
- }
- // Org System
- YCMD:leader(playerid, params[], help) { // leader command
- if( PI [ playerid ][ xLeader ] < 1) return SendClientMessage( playerid, COLOR_RED, "You can't use this command. " );
- ShowPlayerDialog( playerid, DIALOG_LEADER, DIALOG_STYLE_LIST, "Dimi Scripting", "Invite player\nUninvite player\nGive rank\nAll members", "Confirm", "Cancel" );
- return true;
- }
- YCMD:orghelp(playerid, params[], help) // command for see all cmds for organization
- {
- SendClientMessage( playerid, COLOR_GREEN, "/makeorganization /makesafeorg /editorganization /orglist");
- SendClientMessage( playerid, COLOR_GREEN, "/orgvehicle /orgcolor /r /f /members /leader /makeleader");
- return true;
- }
- YCMD:makeorganization(playerid, params[], help) // command for make a organization
- {
- // if( PI[ playerid ][ xAdmin ] < 1) return SendClientMessage(playerid, COLOR_RED, "You can't use this command." );
- ShowPlayerDialog( playerid, DIALOG_ORGCREATE, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter name for organization!", "Confirm", "Cancel" );
- return true;
- }
- YCMD:makeleader(playerid, params[], help) // command for make a safe for organization
- {
- // if( PI[ playerid ][ xAdmin ] < 1) return SendClientMessage(playerid, COLOR_RED, "You can't use this command." );
- new id,orga,ImaFajl[50],ime1[MAX_PLAYER_NAME],podatak;
- if(sscanf(params, "ui", id, orga)) return SendClientMessage( playerid, COLOR_GREEN, "Usage: /makeleader [ID player] [ID org]");
- GetPlayerName(id, ime1, sizeof ime1);
- format( ImaFajl, sizeof( ImaFajl ), O_FILE, orga );
- if( orga == 0) {
- if( PI[ id ][ xLeader ] == 0) return SendClientMessage(playerid, COLOR_GREEN, "That player isn't leader of any organization." );
- podatak = PI[ id ][ xLeader ];
- strmid( OI[ podatak ][ oLeader ], "No-one", 0, strlen("No-one"), ORG_LEADER);
- SaveOrganization( podatak ); Orge3D( podatak );
- PI[ id ][ xLeader ] = 0; PI[ id ][ xRank ] = 0; PI[ id ][ xMember ] = 0; PI[ id ][ xSkin ] = 3;
- SetPlayerSkin( id, 3 );
- SendClientMessage(id, COLOR_GREEN, "You are demoted from leader of organization.");
- SendClientMessage(playerid, COLOR_GREEN, "You demoted player from leader of organization.");
- }
- else {
- if( !fexist( ImaFajl ) ) return SendClientMessage(playerid, COLOR_GREEN, "That organization doesn't exist." );
- if( !strcmp( OI[ orga ][ oLeader ], "No-one", true ) )
- {
- PI[ id ][ xLeader ] = orga;
- PI[ id ][ xMember ] = orga;
- PI[ id ][ xRank ] = 6;
- PI[ id ][ xSkin ] = OI[ orga ][ oSkin6 ];
- SetPlayerSkin( id, OI[ orga ][ oSkin6 ] );
- SendClientMessage(id, COLOR_GREEN, "You are promoted for leader of organization.");
- SendClientMessage(playerid, COLOR_GREEN, "You promoted player for leader of organization.");
- strmid( OI[ orga ][ oLeader ], ime1, 0, strlen( ime1 ), 255 );
- SaveOrganization( orga ); Orge3D( orga );
- }
- else return SendClientMessage(playerid, COLOR_RED, "That organization already have a leader!");
- }
- return 1;
- }
- YCMD:makesafeorg(playerid, params[], help) // command for make a safe for organization
- {
- // if( PI[ playerid ][ xAdmin ] < 1) return SendClientMessage(playerid, COLOR_RED, "You can't use this command." );
- ShowPlayerDialog( playerid, DIALOG_ORGSCREATE, DIALOG_STYLE_INPUT, "Dimi Scripting", "Enter ID of organization which u make a safe.!", "Confirm", "Cancel" );
- return true;
- }
- YCMD:editorganization(playerid, params[], help) // command for edit organization
- {
- // if( PI[ playerid ][ xAdmin ] < 1) return SendClientMessage(playerid, COLOR_RED, "You can't use this command." );
- ShowPlayerDialog( playerid, DIALOG_ORGEDIT, DIALOG_STYLE_LIST, "Dimi Scripting", "Change name\nChange Interior\nChange Ranks\nChange Skins\nPromeni Tip\nChange Color\nAddd Vehicles", "Confirm", "Cancel" );
- return true;
- }
- YCMD:orglist(playerid, params[], help) { // command for list of created organization
- // if( PI[ playerid ][ xAdmin ] < 1) return SendClientMessage(playerid, COLOR_RED, "You can't use this command." );
- new info[1024];
- for(new i = 1; i < MAX_ORG; i++)
- {
- new oFile[100];
- format(oFile, 100, O_FILE, i);
- if(fexist(oFile))
- {
- new string[256];
- format(string, sizeof(string), "ID : %d | Organization Name: %s\n", OI[ i ][ oID ], OI[ i ][ oName ]);
- strcat(info, string, sizeof(info));
- }
- }
- ShowPlayerDialog(playerid, DIALOG_ORGLIST, DIALOG_STYLE_MSGBOX, "Dimi Scripting", info, "Confirm", "Cancel");
- return 1;
- }
- YCMD:orgvehicle(playerid, params[], help) { // make a vehicle for organization
- // if( PI[ playerid ][ xAdmin ] < 1) return SendClientMessage(playerid, COLOR_RED, "You can't use this command." );
- new VehicleID, OrgID, SlotNumber, ImaFajl[50], Float:PozX, Float:PozY, Float:PozZ, Float:PozA;
- if( sscanf( params, "iii", OrgID, VehicleID, SlotNumber) ) return SendClientMessage( playerid, COLOR_WHITE, "Usage: /orgvehicle [ ID of org] [ ID vehicle ] [ Number of vehicle slot(1-12)]." );
- format( ImaFajl, sizeof( ImaFajl ), O_FILE, OrgID );
- if( !fexist( ImaFajl ) ) return SendClientMessage(playerid, COLOR_RED, "That organization doesn't exist." );
- if( OI[ OrgID ][ oColor_1 ] < 0 ) return SendClientMessage( playerid, COLOR_RED, "First u need change a color of organization(/orgcolor)." );
- if( VehicleID < 400 || VehicleID > 611 ) return SendClientMessage(playerid, COLOR_RED, "ID of vehicle can't be bigger then 611 and lower then 400." );
- if( SlotNumber < 1 || SlotNumber > 12 ) return SendClientMessage(playerid, COLOR_RED, "The number of slot can't be bigger then 12 and lower then 1." );
- GetPlayerPos( playerid , PozX, PozY, PozZ );
- GetPlayerFacingAngle( playerid , PozA );
- if( SlotNumber == 1 ) {
- if( OI[ OrgID ][ oVehicle_1 ] != 0 ) return SendClientMessage(playerid, COLOR_RED, "In this slot already exist vehicle.");
- OI[ OrgID ][ oVehicle_1 ] = VehicleID;
- OI[ OrgID ][ oVehicle_1_PosX ] = PozX;
- OI[ OrgID ][ oVehicle_1_PosY ] = PozY;
- OI[ OrgID ][ oVehicle_1_PosZ ] = PozZ;
- OI[ OrgID ][ oVehicle_1_PosA ] = PozA;
- OrgVehicle[OrgID][0] = CreateVehicle(VehicleID, PozX, PozY, PozZ, PozA, OI[ OrgID ][ oColor_1 ], OI[ OrgID ][ oColor_2 ], -1);
- SaveOrganization( OrgID ); SendClientMessage( playerid, COLOR_GREEN, "Successfully created vehicle for organization." ); }
- else if( SlotNumber == 2 ) {
- if( OI[ OrgID ][ oVehicle_2 ] != 0 ) return SendClientMessage(playerid, COLOR_RED, "In this slot already exist vehicle.");
- OI[ OrgID ][ oVehicle_2 ] = VehicleID;
- OI[ OrgID ][ oVehicle_2_PosX ] = PozX;
- OI[ OrgID ][ oVehicle_2_PosY ] = PozY;
- OI[ OrgID ][ oVehicle_2_PosZ ] = PozZ;
- OI[ OrgID ][ oVehicle_2_PosA ] = PozA;
- OrgVehicle[OrgID][1] = CreateVehicle(VehicleID, PozX, PozY, PozZ, PozA, OI[ OrgID ][ oColor_1 ], OI[ OrgID ][ oColor_2 ], -1);
- SaveOrganization( OrgID ); SendClientMessage( playerid, COLOR_GREEN, "Successfully created vehicle for organization." ); }
- else if( SlotNumber == 3 ) {
- if( OI[ OrgID ][ oVehicle_3 ] != 0 ) return SendClientMessage(playerid, COLOR_RED, "In this slot already exist vehicle.");
- OI[ OrgID ][ oVehicle_3 ] = VehicleID;
- OI[ OrgID ][ oVehicle_3_PosX ] = PozX;
- OI[ OrgID ][ oVehicle_3_PosY ] = PozY;
- OI[ OrgID ][ oVehicle_3_PosZ ] = PozZ;
- OI[ OrgID ][ oVehicle_3_PosA ] = PozA;
- OrgVehicle[OrgID][2] = CreateVehicle(VehicleID, PozX, PozY, PozZ, PozA, OI[ OrgID ][ oColor_1 ], OI[ OrgID ][ oColor_2 ], -1);
- SaveOrganization( OrgID ); SendClientMessage( playerid, COLOR_GREEN, "Successfully created vehicle for organization." ); }
- else if( SlotNumber == 4 ) {
- if( OI[ OrgID ][ oVehicle_4 ] != 0 ) return SendClientMessage(playerid, COLOR_RED, "In this slot already exist vehicle.");
- OI[ OrgID ][ oVehicle_4 ] = VehicleID;
- OI[ OrgID ][ oVehicle_4_PosX ] = PozX;
- OI[ OrgID ][ oVehicle_4_PosY ] = PozY;
- OI[ OrgID ][ oVehicle_4_PosZ ] = PozZ;
- OI[ OrgID ][ oVehicle_4_PosA ] = PozA;
- OrgVehicle[OrgID][3] = CreateVehicle(VehicleID, PozX, PozY, PozZ, PozA, OI[ OrgID ][ oColor_1 ], OI[ OrgID ][ oColor_2 ], -1);
- SaveOrganization( OrgID ); SendClientMessage( playerid, COLOR_GREEN, "Successfully created vehicle for organization." ); }
- else if( SlotNumber == 5 ) {
- if( OI[ OrgID ][ oVehicle_5 ] != 0 ) return SendClientMessage(playerid, COLOR_RED, "In this slot already exist vehicle.");
- OI[ OrgID ][ oVehicle_5 ] = VehicleID;
- OI[ OrgID ][ oVehicle_5_PosX ] = PozX;
- OI[ OrgID ][ oVehicle_5_PosY ] = PozY;
- OI[ OrgID ][ oVehicle_5_PosZ ] = PozZ;
- OI[ OrgID ][ oVehicle_5_PosA ] = PozA;
- OrgVehicle[OrgID][4] = CreateVehicle(VehicleID, PozX, PozY, PozZ, PozA, OI[ OrgID ][ oColor_1 ], OI[ OrgID ][ oColor_2 ], -1);
- SaveOrganization( OrgID ); SendClientMessage( playerid, COLOR_GREEN, "Successfully created vehicle for organization." ); }
- else if( SlotNumber == 6 ) {
- if( OI[ OrgID ][ oVehicle_6 ] != 0 ) return SendClientMessage(playerid, COLOR_RED, "In this slot already exist vehicle.");
- OI[ OrgID ][ oVehicle_6 ] = VehicleID;
- OI[ OrgID ][ oVehicle_6_PosX ] = PozX;
- OI[ OrgID ][ oVehicle_6_PosY ] = PozY;
- OI[ OrgID ][ oVehicle_6_PosZ ] = PozZ;
- OI[ OrgID ][ oVehicle_6_PosA ] = PozA;
- OrgVehicle[OrgID][5] = CreateVehicle(VehicleID, PozX, PozY, PozZ, PozA, OI[ OrgID ][ oColor_1 ], OI[ OrgID ][ oColor_2 ], -1);
- SaveOrganization( OrgID ); SendClientMessage( playerid, COLOR_GREEN, "Successfully created vehicle for organization." ); }
- else if( SlotNumber == 7 ) {
- if( OI[ OrgID ][ oVehicle_7 ] != 0 ) return SendClientMessage(playerid, COLOR_RED, "In this slot already exist vehicle.");
- OI[ OrgID ][ oVehicle_7 ] = VehicleID;
- OI[ OrgID ][ oVehicle_7_PosX ] = PozX;
- OI[ OrgID ][ oVehicle_7_PosY ] = PozY;
- OI[ OrgID ][ oVehicle_7_PosZ ] = PozZ;
- OI[ OrgID ][ oVehicle_7_PosA ] = PozA;
- OrgVehicle[OrgID][6] = CreateVehicle(VehicleID, PozX, PozY, PozZ, PozA, OI[ OrgID ][ oColor_1 ], OI[ OrgID ][ oColor_2 ], -1);
- SaveOrganization( OrgID ); SendClientMessage( playerid, COLOR_GREEN, "Successfully created vehicle for organization." ); }
- else if( SlotNumber == 8 ) {
- if( OI[ OrgID ][ oVehicle_8 ] != 0 ) return SendClientMessage(playerid, COLOR_RED, "In this slot already exist vehicle.");
- OI[ OrgID ][ oVehicle_8 ] = VehicleID;
- OI[ OrgID ][ oVehicle_8_PosX ] = PozX;
- OI[ OrgID ][ oVehicle_8_PosY ] = PozY;
- OI[ OrgID ][ oVehicle_8_PosZ ] = PozZ;
- OI[ OrgID ][ oVehicle_8_PosA ] = PozA;
- OrgVehicle[OrgID][7] = CreateVehicle(VehicleID, PozX, PozY, PozZ, PozA, OI[ OrgID ][ oColor_1 ], OI[ OrgID ][ oColor_2 ], -1);
- SaveOrganization( OrgID ); SendClientMessage( playerid, COLOR_GREEN, "Successfully created vehicle for organization." ); }
- else if( SlotNumber == 9 ) {
- if( OI[ OrgID ][ oVehicle_9 ] != 0 ) return SendClientMessage(playerid, COLOR_RED, "In this slot already exist vehicle.");
- OI[ OrgID ][ oVehicle_9 ] = VehicleID;
- OI[ OrgID ][ oVehicle_9_PosX ] = PozX;
- OI[ OrgID ][ oVehicle_9_PosY ] = PozY;
- OI[ OrgID ][ oVehicle_9_PosZ ] = PozZ;
- OI[ OrgID ][ oVehicle_9_PosA ] = PozA;
- OrgVehicle[OrgID][8] = CreateVehicle(VehicleID, PozX, PozY, PozZ, PozA, OI[ OrgID ][ oColor_1 ], OI[ OrgID ][ oColor_2 ], -1);
- SaveOrganization( OrgID ); SendClientMessage( playerid, COLOR_GREEN, "Successfully created vehicle for organization." ); }
- else if( SlotNumber == 10 ) {
- if( OI[ OrgID ][ oVehicle_10 ] != 0 ) return SendClientMessage(playerid, COLOR_RED, "In this slot already exist vehicle.");
- OI[ OrgID ][ oVehicle_10 ] = VehicleID;
- OI[ OrgID ][ oVehicle_10_PosX ] = PozX;
- OI[ OrgID ][ oVehicle_10_PosY ] = PozY;
- OI[ OrgID ][ oVehicle_10_PosZ ] = PozZ;
- OI[ OrgID ][ oVehicle_10_PosA ] = PozA;
- OrgVehicle[OrgID][9] = CreateVehicle(VehicleID, PozX, PozY, PozZ, PozA, OI[ OrgID ][ oColor_1 ], OI[ OrgID ][ oColor_2 ], -1);
- SaveOrganization( OrgID ); SendClientMessage( playerid, COLOR_GREEN, "Successfully created vehicle for organization." ); }
- else if( SlotNumber == 11 ) {
- if( OI[ OrgID ][ oVehicle_11 ] != 0 ) return SendClientMessage(playerid, COLOR_RED, "In this slot already exist vehicle.");
- OI[ OrgID ][ oVehicle_11 ] = VehicleID;
- OI[ OrgID ][ oVehicle_11_PosX ] = PozX;
- OI[ OrgID ][ oVehicle_11_PosY ] = PozY;
- OI[ OrgID ][ oVehicle_11_PosZ ] = PozZ;
- OI[ OrgID ][ oVehicle_11_PosA ] = PozA;
- OrgVehicle[OrgID][10] = CreateVehicle(VehicleID, PozX, PozY, PozZ, PozA, OI[ OrgID ][ oColor_1 ], OI[ OrgID ][ oColor_2 ], -1);
- SaveOrganization( OrgID ); SendClientMessage( playerid, COLOR_GREEN, "Successfully created vehicle for organization." ); }
- else if( SlotNumber == 12 ) {
- if( OI[ OrgID ][ oVehicle_12 ] != 0 ) return SendClientMessage(playerid, COLOR_RED, "In this slot already exist vehicle.");
- OI[ OrgID ][ oVehicle_12 ] = VehicleID;
- OI[ OrgID ][ oVehicle_12_PosX ] = PozX;
- OI[ OrgID ][ oVehicle_12_PosY ] = PozY;
- OI[ OrgID ][ oVehicle_12_PosZ ] = PozZ;
- OI[ OrgID ][ oVehicle_12_PosA ] = PozA;
- OrgVehicle[OrgID][11] = CreateVehicle(VehicleID, PozX, PozY, PozZ, PozA, OI[ OrgID ][ oColor_1 ], OI[ OrgID ][ oColor_2 ], -1);
- SaveOrganization( OrgID ); SendClientMessage( playerid, COLOR_GREEN, "Successfully created vehicle for organization." ); }
- else {
- SendClientMessage(playerid, COLOR_RED, "The number of slot can't be bigger then 12 and lower then 1."); }
- return true;
- }
- YCMD:orgcolor(playerid, params[], help) { // change a color of vehicle
- // if( PI[ playerid ][ xAdmin ] < 6) return SendClientMessage(playerid, COLOR_RED, "You can't use this command.");
- new color, OrgID, ImaFajl[50];
- if( sscanf( params, "iii", OrgID, color) ) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /orgcolor [ ID of org ] [ Color ].");
- format( ImaFajl, sizeof( ImaFajl ), O_FILE, OrgID );
- if( !fexist( ImaFajl ) ) return SendClientMessage(playerid, COLOR_RED, "That organization doesn't exist." );
- if( color < 0 || color > 255 ) return SendClientMessage(playerid, COLOR_RED, "The ID of color can't be bigger then 255 or lower then 0." );
- OI[ OrgID ][ oColor_1 ] = color; OI[ OrgID ][ oColor_2 ] = color;
- SaveOrganization( OrgID );
- SendClientMessage(playerid, COLOR_GREEN, "Successfully changed color for organization.");
- return true;
- }
- YCMD:r(playerid, params[], help) { // chat for legal organization(radio)
- new message[256], string[512];
- if( OI[ PI[ playerid ][ xMember ] ][ oType ] != 1 ) return SendClientMessage(playerid, COLOR_RED, "You can't use this command.");
- if(sscanf(params, "s[256]", message)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /r [Text]");
- if( PI[ playerid ][ xLeader ] > 0 || PI[ playerid ][ xMember ] > 0) {
- if( PI[ playerid ][ xRank ] == 1) format(string, sizeof string, "** %s %s: %s, over. **", OI[ PI[ playerid ][ xMember ]][ oRank1 ], PlayerName( playerid ), message );
- else if( PI[ playerid ][ xRank ] == 2) format(string, sizeof string, "** %s %s: %s, over. **", OI[ PI[ playerid ][ xMember ]][ oRank2 ], PlayerName( playerid ), message );
- else if( PI[ playerid ][ xRank ] == 3) format(string, sizeof string, "** %s %s: %s, over. **", OI[ PI[ playerid ][ xMember ]][ oRank3 ], PlayerName( playerid ), message );
- else if( PI[ playerid ][ xRank ] == 4) format(string, sizeof string, "** %s %s: %s, over. **", OI[ PI[ playerid ][ xMember ]][ oRank4 ], PlayerName( playerid ), message );
- else if( PI[ playerid ][ xRank ] == 5) format(string, sizeof string, "** %s %s: %s, over. **", OI[ PI[ playerid ][ xMember ]][ oRank5 ], PlayerName( playerid ), message );
- else if( PI[ playerid ][ xRank ] == 6) format(string, sizeof string, "** %s %s: %s, over. **", OI[ PI[ playerid ][ xLeader ]][ oRank6 ], PlayerName( playerid ), message );
- OrgMessage( PI[ playerid ][ xMember ], 0x83BFBFFF, string ); }
- else { SendClientMessage(playerid, COLOR_RED, "You can't use this command."); return true; }
- return true;
- }
- YCMD:members(playerid, params[], help) { // list of online members
- new string[ 140 ], OrgID;
- if( PI[ playerid ][ xMember ] != 0 ) OrgID = PI[ playerid ][ xMember ];
- else return SendClientMessage(playerid, COLOR_RED, "You can't use this command.");
- SendClientMessage(playerid, COLOR_ORANGE, "|----------------Members Online----------------|");
- foreach (Player, i) {
- format(string, sizeof(string), "");
- if( PI[ i ][ xLeader ] == OrgID ) format(string, sizeof(string), "%s (Leader)", PlayerName( i ) );
- else if( PI[ playerid ][ xMember ] == OrgID ) format(string, sizeof(string), "%s, Rank: %d.", PlayerName( i ), PI[ i ][ xRank ] );
- if(strlen(string) > 1) SendClientMessage(playerid, COLOR_ORANGE, string);
- }
- return true;
- }
- YCMD:f(playerid, params[], help) { // chat of ilegal organization
- new message[256], string[512];
- if( OI[ PI[ playerid ][ xMember ] ][ oType ] == 2 && OI[ PI[ playerid ][ xMember ] ][ oType ] == 3 ) return SendClientMessage(playerid, COLOR_RED, "You can't use this command.");
- if(sscanf(params, "s[256]", message)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /f [Text]");
- if( PI[ playerid ][ xLeader ] > 0 || PI[ playerid ][ xMember ] > 0) {
- if( PI[ playerid ][ xRank ] == 1) format(string, sizeof string, "** %s %s: %s. )) **", OI[ PI[ playerid ][ xMember ]][ oRank1 ], PlayerName( playerid ), message );
- else if( PI[ playerid ][ xRank ] == 2) format(string, sizeof string, "** %s %s: %s. )) **", OI[ PI[ playerid ][ xMember ]][ oRank2 ], PlayerName( playerid ), message );
- else if( PI[ playerid ][ xRank ] == 3) format(string, sizeof string, "** %s %s: %s. )) **", OI[ PI[ playerid ][ xMember ]][ oRank3 ], PlayerName( playerid ), message );
- else if( PI[ playerid ][ xRank ] == 4) format(string, sizeof string, "** %s %s: %s. )) **", OI[ PI[ playerid ][ xMember ]][ oRank4 ], PlayerName( playerid ), message );
- else if( PI[ playerid ][ xRank ] == 5) format(string, sizeof string, "** %s %s: %s. )) **", OI[ PI[ playerid ][ xMember ]][ oRank5 ], PlayerName( playerid ), message );
- else if( PI[ playerid ][ xRank ] == 6) format(string, sizeof string, "** %s %s: %s. )) **", OI[ PI[ playerid ][ xLeader ]][ oRank6 ], PlayerName( playerid ), message );
- OrgMessage( PI[ playerid ][ xMember ], 0x01FCFFC8, string ); }
- else { SendClientMessage(playerid, COLOR_RED, "You can't use this command."); return true; }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment