SHOW:
|
|
- or go back to the newest paste.
1 | // Criado por Monstrinho Verde com a ajuda do tutorial do Josma_cmd | |
2 | //Caso encontre algum Bug tente resolver, pois sou novato em script!!! | |
3 | //Caso ache o FS incompleto, complete-o e coloque os seus créditos e mande-o de novo para mim. | |
4 | //Não retire os créditos | |
5 | ||
6 | ||
7 | #include <a_samp> | |
8 | #include zcmd | |
9 | #include sscanf | |
10 | #include sii | |
11 | ||
12 | enum Info | |
13 | { | |
14 | Membro, | |
15 | Cargo, | |
16 | }; | |
17 | new ProgressaoInfo[MAX_PLAYERS][Info]; | |
18 | new Nomeorgs[1][128] = | |
19 | { | |
20 | "Euskadi Ta Askatasuna" | |
21 | }; | |
22 | new VETA[17]; | |
23 | new Texto[256]; | |
24 | new guerra; | |
25 | forward guerrat(); | |
26 | ||
27 | ||
28 | const C_ETA = 0xFFAE00 | |
29 | ||
30 | VETA[0] = CreateVehicle(595,1619.69995117,580.90002441,0xFFAE00,0xFFAE00,-1,-1,15); | |
31 | VETA[1] = CreateVehicle(595,1637.09997559,581.70001221,0xFFAE00,0xFFAE00,-1,-1,15); | |
32 | VETA[2] = CreateVehicle(520,1589.09997559,605.90002441,0xFFAE00,0xFFAE00,-1,-1,15); | |
33 | VETA[3] = CreateVehicle(520,1599.30004883,606.00000000,0xFFAE00,0xFFAE00,-1,-1,15); | |
34 | VETA[4] = CreateVehicle(425,1654.00000000,606.29998779,0xFFAE00,0xFFAE00,-1,-1,15); | |
35 | VETA[5] = CreateVehicle(425,1642.80004883,605.90002441,0xFFAE00,0xFFAE00,-1,-1,15); | |
36 | VETA[6] = CreateVehicle(487,1628.80004883,582.00000000,0xFFAE00,0xFFAE00,-1,-1,15); | |
37 | VETA[7] = CreateVehicle(432,1621.30004883,627.90002441,0xFFAE00,0xFFAE00,-1,-1,15); | |
38 | VETA[8] = CreateVehicle(432,1633.90002441,628.20001221,0xFFAE00,0xFFAE00,-1,-1,15); | |
39 | VETA[9] = CreateVehicle(451,1614.09997559,619.29998779,0xFFAE00,0xFFAE00,-1,-1,15); | |
40 | VETA[10] = CreateVehicle(560,1641.19995117,619.09997559,0xFFAE00,0xFFAE00,-1,-1,15); | |
41 | VETA[11] = CreateVehicle(559,1655.00000000,619.20001221,0xFFAE00,0xFFAE00,-1,-1,15); | |
42 | VETA[12] = CreateVehicle(562,1599.50000000,619.40002441,0xFFAE00,0xFFAE00,-1,-1,15); | |
43 | VETA[13] = CreateVehicle(468,1630.00000000,623.40002441,0xFFAE00,0xFFAE00,-1,-1,15); | |
44 | VETA[14] = CreateVehicle(468,1625.00000000,623.20001221,0xFFAE00,0xFFAE00,-1,-1,15); | |
45 | VETA[15] = CreateVehicle(522,1628.59997559,623.29998779,0xFFAE00,0xFFAE00,-1,-1,15); | |
46 | VETA[16] = CreateVehicle(522,1626.40002441,623.20001221,0xFFAE00,0xFFAE00,-1,-1,15); | |
47 | VETA[17] = CreateVehicle(533,1586.90002441,619.29998779,0xFFAE00,0xFFAE00,-1,-1,15); | |
48 | ||
49 | #define VETA(%0,%1,%2) GetPlayerVehicleID(playerid) >= %0[%1] && GetPlayerVehicleID(playerid) <= %0[%2] | |
50 | ||
51 | public OnPlayerStateChange(playerid, newstate, oldstate) | |
52 | { | |
53 | if(newstate == PLAYER_STATE_DRIVER) | |
54 | { | |
55 | ||
56 | if(VETA(VETA,0,4) && ProgressaoInfo[playerid][Membro] != 2) return RemovePlayerFromVehicle(playerid), SendClientMessage(playerid, C_Assassinos, "Você não pertence à ETA"); | |
57 | } | |
58 | return true; | |
59 | } | |
60 | cmd(membros, playerid, params[]) | |
61 | { | |
62 | #pragma unused params | |
63 | new corda[70]; | |
64 | for(new i, PP = GetMaxPlayers(); i < PP; i++) | |
65 | { | |
66 | if(!IsPlayerConnected(PP)) continue; | |
67 | if(ProgressaoInfo[i][Membro] == ProgressaoInfo[playerid][Membro]) | |
68 | { | |
69 | new nome[MAX_PLAYER_NAME]; | |
70 | GetPlayerName(playerid, nome, sizeof(nome)); | |
71 | format(corda, sizeof(corda), "%s é membro da org %s e possui cargo %d\n", nome, Orgnome[ProgressaoInfo[i][Membro]], ProgressaoInfo[i][Cargo]); //Formatará a string corda com o nome, cargo e nome da org pertencente. | |
72 | strcat(Texto, corda, 70); | |
73 | } | |
74 | } | |
75 | ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Lista de membros online", Texto, "OK", ""); | |
76 | strdel(Texto, 0, sizeof(Texto)); | |
77 | return true; | |
78 | } | |
79 | cmd(equipar, playerid, params[]) | |
80 | { | |
81 | #pragma unused params | |
82 | if(ProgressaoInfo[playerid][Membro] == 1 && IsPlayerInRangeOfPoint(playerid, 3.0, Float:X, Float:Y, Float:Z)) //No X, Y e Z as coordenadas do local de equipe da org 1 = Assassinos | |
83 | { | |
84 | ResetPlayerWeapons(playerid); | |
85 | GivePlayerWeapon(playerid, 31, 500); | |
86 | GivePlayerWeapon(playerid, 24, 300); | |
87 | GivePlayerWeapon(playerid, 25, 250); | |
88 | GivePlayerWeapon(playerid, 39, 10); | |
89 | GivePlayerWeapon(playerid, 40, 1); | |
90 | GivePlayerWeapon(playerid, 34, 10); | |
91 | GivePlayerWeapon(playerid, 4, 1); | |
92 | GivePlayerWeapon(playerid, 29,4); | |
93 | SendClientMessage(playerid, C_ETA, "%s pegou seus equipamentos de terrorismo", nome); | |
94 | return true; | |
95 | } | |
96 | } | |
97 | cmd(chatorg, playerid, params[]) | |
98 | { | |
99 | new corda[128]; | |
100 | if(sscanf(params, "s[128]", corda)) return SendClientMessage(playerid, GetPlayerColor(playerid), "Use /ga [Texto]"); | |
101 | if(ProgressaoInfo[playerid][Membro] == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "Você é um Civil, não pode usar o chat da ETA!"); | |
102 | new nome[MAX_PLAYER_NAME]; | |
103 | GetPlayerName(playerid, nome, sizeof(nome)); | |
104 | format(Texto, 128, "%s[%d] diz: %s", nome, ProgressaoInfo[playerid][Cargo], corda); | |
105 | for(new PP, Progressao = GetMaxPlayers(); PP < Progressao; PP++) | |
106 | { | |
107 | if(!IsPlayerConnected(PP)) continue; | |
108 | if(ProgressaoInfo[PP][Membro] == ProgressaoInfo[playerid][Membro]) | |
109 | { | |
110 | SendClientMessage(PP, GetPlayerColor(playerid), Texto); | |
111 | } | |
112 | } | |
113 | return true; | |
114 | } | |
115 | cmd(convidar, playerid, params[]) | |
116 | { | |
117 | new PlayerB, nome[MAX_PLAYER_NAME]; | |
118 | if(sscanf(params, "d", PlayerB)) return SendClientMessage(playerid, 0x1E90FF99, "Use /convidar [id]"); | |
119 | if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, 0x1E90FF99, "Este jogador não está online"); | |
120 | GetPlayerName(PlayerB, nome, sizeof(nome)); | |
121 | format(Texto, 70, "Você convidou %s para sua organização", nome); | |
122 | SendClientMessage(playerid, GetPlayerColor(playerid), Texto); | |
123 | GetPlayerName(playerid, nome, sizeof(nome)); | |
124 | format(Texto, 128, "%s está lhe convidando para fazer parte da organização: %s \nDeseja aceitar?", nome, Nomeorgs[ProgressaoInfo[playerid][Membro]]); | |
125 | ShowPlayerDialog(PlayerB, 100, DIALOG_STYLE_MSGBOX, "Convite para organização", Texto, "Sim", "Não"); | |
126 | SetPVarInt(PlayerB, "OrgConvidado", ProgressaoInfo[playerid][Membro]); | |
127 | return true; | |
128 | } | |
129 | public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) | |
130 | { | |
131 | if(dialogid == 100 && response) | |
132 | { | |
133 | ProgressaoInfo[playerid][Membro] = GetPVarInt(playerid, "OrgConvidado"); | |
134 | ProgressaoInfo[playerid][Cargo] = 1; | |
135 | DeletePVar(playerid, "OrgConvidado"); | |
136 | return true; | |
137 | } | |
138 | return true; | |
139 | } | |
140 | cmd(promover, playerid, params[]) | |
141 | { | |
142 | new PlayerB, cargo; | |
143 | if(sscanf(params, "dd", PlayerB, Cargo)) return SendClientMessage(playerid, 0x1E90FF99, "Use /Promover [id] [cargo]"); | |
144 | if(ProgressaoInfo[playerid][Cargo] != 10) return SendClientMessage(playerid, 0x1E90FF99, "Você não é líder"); | |
145 | if(ProgressaoInfo[PlayerB][Membro] != ProgressaoInfo[playerid][Membro]) return SendClientMessage(playerid, 0x1E90FF99, "Este jogador não é da sua organização."); | |
146 | ProgressaoInfo[playerid][Cargo] = cargo; | |
147 | return true; | |
148 | } | |
149 | cmd(demitir, playerid, params[]) | |
150 | { | |
151 | new PlayerB; | |
152 | if(sscanf(params, "d", PlayerB)) return SendClientMessage(playerid, 0x1E90FF99, "Use /Demitir [id]"); | |
153 | if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, 0x1E90FF99, "Este jogador não está online"); | |
154 | if(ProgressaoInfo[playerid][Membro] != ProgressaoInfo[PlayerB][Membro]) return SendClientMessage(playerid, 0x1E90FF99, "Este jogador não é da sua organização"); | |
155 | if(ProgressaoInfo[playerid][Cargo] != 10) return SendClientMessage(playerid, 0x1E90FF99, "Você não é líder da organização"); | |
156 | ProgressaoInfo[PlayerB][Membro] = 0; //Tornará o player demitido um civil novamente. | |
157 | ProgressaoInfo[PlayerB][Cargo] = 0; //Atribuirá o cargo 0 ao player demitido, afinal, agora ele não pertence à org alguma. | |
158 | SendClientMessage(PlayerB, C_Civil, "Você foi demitido"); | |
159 | SetPlayerColor(playerid, C_Civil); | |
160 | SendClientMessage(playerid, 0x1E90FF99, "Jogador demitido"); | |
161 | return true; | |
162 | } | |
163 | public OnPlayerDisconnect(playerid, reason) | |
164 | { | |
165 | SalvarPlayer(playerid); | |
166 | return true; | |
167 | } | |
168 | ||
169 | stock SalvarPlayer(playerid) | |
170 | { | |
171 | new nome[MAX_PLAYER_NAME]; | |
172 | GetPlayerName(playerid, nome, sizeof(nome)); | |
173 | format(Texto, 35, "Jogadores/%s", nome); | |
174 | INI_Open(Texto); | |
175 | INI_WriteInt("Organização", ProgressaoInfo[playerid][Membro]); | |
176 | INI_WriteInt("Cargo", ProgressaoInfo[playerid][Cargo]); | |
177 | INI_Save(); | |
178 | INI_Close(); | |
179 | return true; | |
180 | } | |
181 | public OnPlayerConnect(playerid) | |
182 | { | |
183 | new nome[MAX_PLAYER_NAME]; | |
184 | GetPlayerName(playerid, nome, sizeof(nome)); | |
185 | format(Texto, 35, "Jogadores/%s", nome); | |
186 | if(fexist(Texto)) | |
187 | { | |
188 | INI_Open(Texto); | |
189 | ProgressaoInfo[playerid][Membro] = INI_ReadInt("Organização"); | |
190 | ProgressaoInfo[playerid][Cargo] = INI_ReadInt("Cargo"); | |
191 | INI_Close(); | |
192 | } | |
193 | return true; | |
194 | } | |
195 | public OnPlayerCommandText | |
196 | if(strcmp(cmd,"/guerra", true) == 0) | |
197 | { | |
198 | if(PlayerInfo[playerid][pLider]==3) | |
199 | { | |
200 | new Float:X,Float:Y,Float:Z; | |
201 | GetPlayerPos(playerid, X,Y,Z); | |
202 | guerra = GangZoneCreate(X-100,Y-100,X+100,Y+100); | |
203 | GangZoneShowForAll(guerra,0xFFAE00); | |
204 | SetTimer("guerrat",120000,1); | |
205 | new pName[MAX_PLAYER_NAME]; | |
206 | GetPlayerName(playerid, pName, sizeof(pName)); | |
207 | format(string, sizeof(string), "O líder %s da ETA começou uma guerra!", pName); | |
208 | SendClientMessageToAll(0xFFAE00, string); | |
209 | } | |
210 | return 1; | |
211 | } | |
212 | public guerrat() | |
213 | { | |
214 | GangZoneDestroy(guerra); | |
215 | GangZoneHideForAll(guerra); | |
216 | return 1; | |
217 | } |