View difference between Paste ID: HJFm988W and cdNZi6gf
SHOW: | | - or go back to the newest paste.
1
#include 	a_samp
2
#include 	zcmd
3
#include 	sscanf2
4
#include    DOF2
5
6
7
#define NAOADM 				"Não tem autorização suficiente."
8
#define Controle(%0,%1) 	TogglePlayerControllable(%0,%1)
9
#define adm              	"Adm\\%s.ini"
10
#define banido              "Ban\\%s.ini"
11
#define paramount(%0,%1) for(new %0; %0 < %1; ++%0) if(IsPlayerConnected(%0) && !IsPlayerNPC(%0))
12
13
const verde = 0x5EAF03FF;
14
const fail = 0xFF0000FF;
15
16
enum pInfo
17
{
18
	pAdmin,
19
	pBan,
20
	pAutorizado,
21
};
22
23
//------------------------------------------------------------------------------
24
25
new info[MAX_PLAYERS][pInfo];
26
27
new
28
	arquivo[36],
29
	nome[24],
30
	ip[16],
31
	string_[168],
32
	str[128],
33
	bool:espiando[MAX_PLAYERS];
34
35
new
36
	bool:calado[MAX_PLAYERS];
37
38
new
39
	bool:votou[MAX_PLAYERS],
40
	bool:enquete,
41
	sim,nao;
42
43
//------------------------------------------------------------------------------
44
CMD:votacao(playerid,params[])
45
{
46
	if(info[playerid][pAdmin] >= 1)
47
	{
48
	    new
49
			pergunta[128]
50
		;
51
		if(sscanf(params,"s[128]",pergunta)) return SendClientMessage(playerid,-1,"use /enquete [pergunta]");
52
		format(string_,48,"enquete do admin %s: %s",PlayerName(playerid),pergunta);
53
		SendClientMessageToAll(verde,string_);
54
		SendClientMessageToAll(-1,"Enquete iniciada, use /sim ou /nao para votar.");
55
		enquete = true;
56
	}
57
	else return SendClientMessage(playerid,fail,NAOADM);
58
	return 1;
59
}
60
//------------------------------------------------------------------------------
61
CMD:explodir(playerid,params[])
62
{
63
	if(info[playerid][pAdmin] >= 1)
64
	{
65
	    new
66
	        idx,
67
	        Float:c[3];
68
     	if(sscanf(params,"u",idx)) return SendClientMessage(playerid,-1,"use /explodir [playerid]");
69
     	if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid,fail,"jogador off-line.");
70
      	format(string_,81,"O admin %s explodiu o jogador %s",PlayerName(playerid),PlayerName(idx));
71
       	GetPlayerPos(idx,c[0],c[1],c[2]);
72
		CreateExplosion(c[0],c[1],c[2],12,25.0);
73
		return SendClientMessageToAll(fail,string_);
74
	}
75
	else return SendClientMessage(playerid,fail,NAOADM);
76
}
77
//------------------------------------------------------------------------------
78
CMD:encerrar(playerid,params[])
79
{
80
	if(info[playerid][pAdmin] >= 1)
81
	{
82
	    if(enquete == true)
83
	    {
84
			enquete = false;
85
			format(string_,40,"Resultado: sim : %d | não : %d",sim,nao);
86
			SendClientMessageToAll(fail,string_);
87
			paramount(i,MAX_PLAYERS) return votou[i] = false;
88
			sim = 0,nao = 0;
89
			if(sim > nao) SendClientMessageToAll(verde,"A maioria concorda com a pergunta.");
90
			else SendClientMessageToAll(fail,"A menoria concorda com a pergunta.");
91
		}
92
		else return SendClientMessage(playerid,fail,"Não há uma votação em andamento");
93
	}
94
	else SendClientMessage(playerid,fail,NAOADM);
95
	return 1;
96
}
97
//------------------------------------------------------------------------------
98
CMD:sim(playerid,params[])
99
{
100
	if(enquete == true)
101
	{
102
	    if(votou[playerid] == false)
103
	    {
104
			sim++;
105
			SendClientMessage(playerid,verde,"voto computado com sucesso.");
106
			votou[playerid] = true;
107
		}
108
		else return SendClientMessage(playerid,fail,"já votou");
109
	}
110
	else return SendClientMessage(playerid,fail,"não há votação em andamento.");
111
	return 1;
112
}
113
//------------------------------------------------------------------------------
114
CMD:nao(playerid,params[])
115
{
116
	if(enquete == true)
117
	{
118
	    if(votou[playerid] == false)
119
	    {
120
			nao++;
121
			SendClientMessage(playerid,verde,"voto computado com sucesso.");
122
			votou[playerid] = true;
123
		}
124
		else return SendClientMessage(playerid,fail,"já votou");
125
	}
126
	else return SendClientMessage(playerid,fail,"não há votação em andamento.");
127
	return 1;
128
}
129
//------------------------------------------------------------------------------
130
CMD:setargrana(playerid,params[])
131
{
132
	if(info[playerid][pAdmin] >= 1)
133
	{
134
	    new
135
	        idx,
136
	        quantia
137
		;
138
		if(sscanf(params,"ud",idx,quantia)) return SendClientMessage(playerid,verde,"use /setargrana [playerid] [quantia]");
139
		SetPlayerMoney(playerid,quantia);
140
		SendClientMessage(idx,verde,"seu dinheiro foi setado");
141
		SendClientMessage(playerid,verde,"Dinheiro setado com sucesso.");
142
	}
143
	else return SendClientMessage(playerid,fail,NAOADM);
144
	return 1;
145
}
146
//------------------------------------------------------------------------------
147
CMD:kickartodos(playerid,params[])
148
{
149
	if(info[playerid][pAdmin] >= 3) { paramount(i,MAX_PLAYERS) Kick(i); }
150
	else return SendClientMessage(playerid,fail,NAOADM);
151
	return 1;
152
}
153
//------------------------------------------------------------------------------
154
CMD:trazertodos(playerid,params[])
155
{
156
	if(info[playerid][pAdmin] >= 3)
157
	{
158
	    new
159
			Float:c[3];
160
	    GetPlayerName(playerid,nome,24);
161
	    GetPlayerPos(playerid,c[0],c[1],c[2]);
162
	    format(string_,54,"O administrador %s trouxe todos os jogadores até ele.",nome);
163
		SendClientMessage(playerid,-1,string_);
164
		paramount(i,MAX_PLAYERS) SetPlayerPos(i,c[0],c[1],c[2]);
165
	}
166
	else return SendClientMessage(playerid,fail,NAOADM);
167
	return 1;
168
}
169
//------------------------------------------------------------------------------
170
CMD:renascer(playerid,params[])
171
{
172
    if(info[playerid][pAdmin] >= 1)
173
    {
174
  		new
175
		  	idx;
176
  		if(sscanf(params,"u",idx)) SendClientMessage(playerid,-1,"Use /renascer [id]");
177
		if(!IsPlayerConnected(playerid)) SendClientMessage(playerid,-1,"o jogador está off-line!");
178
		format(string_,64,"O jogador %s foi spawnado pelo admin %s.",PlayerName(idx),PlayerName(playerid));
179
		return SpawnPlayer(idx);
180
	}
181
	else SendClientMessage(playerid,-1,NAOADM);
182
	return 1;
183
}
184
//------------------------------------------------------------------------------
185
CMD:darnivel(playerid,params[])
186
{
187
	if(info[playerid][pAdmin] >= 1)
188
	{
189
	    new 
190
			idx,
191
			lvl;
192
	    GetPlayerName(playerid,nome,24);
193
		if(sscanf(params,"ud",idx,lvl)) return SendClientMessage(playerid,-1,"use /darnivel [playerid] [nivel]");
194
		if(!IsPlayerConnected(idx)) return SendClientMessage(playerid,-1,"Jogador off-line");
195
		format(string_,70,"o administrador %s lhe adicionou %d niveis",nome,lvl);
196
		SetPlayerScore(playerid,GetPlayerScore(idx)+lvl);
197
		SendClientMessage(playerid,-1,string_);
198
	}
199
	else return SendClientMessage(playerid,fail,NAOADM);
200
	return 1;
201
}
202
//------------------------------------------------------------------------------
203
CMD:setarnivel(playerid,params[])
204
{
205
	if(info[playerid][pAdmin] >= 1)
206
	{
207
	    new 
208
			idx,
209
			lvl;
210
	    GetPlayerName(playerid,nome,24);
211
		if(sscanf(params,"ud",idx,lvl)) return SendClientMessage(playerid,-1,"use /darnivel [playerid] [nivel]");
212
		if(!IsPlayerConnected(idx)) return SendClientMessage(playerid,-1,"Jogador off-line");
213
		format(string_,70,"o administrador %s lhe setou nivel %d",nome,lvl);
214
		SetPlayerScore(playerid,lvl);
215
		SendClientMessage(playerid,-1,string_);
216
	}
217
	else return SendClientMessage(playerid,fail,NAOADM);
218
	return 1;
219
}
220
//------------------------------------------------------------------------------
221
CMD:trazer(playerid,params[])
222
{
223
	if(info[playerid][pAdmin] >= 1)
224
	{
225
	    new
226
			idx,
227
			Float:c[3];
228
	    if(sscanf(params,"u",idx)) return SendClientMessage(playerid,-1,"use /trazer [playerid]");
229
	    if(!IsPlayerConnected(idx)) return SendClientMessage(playerid,-1,"Jogador off-line");
230
	    GetPlayerName(playerid,nome,24);
231
	    format(string_,70,"O administador %s lhe trouxe a posição dele.",nome);
232
	    GetPlayerPos(playerid,c[0],c[1],c[2]);
233
	    if(GetPlayerState(idx) == 2) return SetVehiclePos(idx,c[0],c[1],c[2]);
234
	    SendClientMessage(idx,-1,string_);
235
	    SetPlayerPos(idx,c[0],c[1],c[2]);
236
	}
237
	else return SendClientMessage(playerid,fail,NAOADM);
238
	return 1;
239
}
240
//------------------------------------------------------------------------------
241
CMD:ir(playerid,params[])
242
{
243
	if(info[playerid][pAdmin] >= 1)
244
	{
245
	    new
246
			idx,
247
			Float:c[3];
248
	    GetPlayerName(playerid,nome,24);
249
	    if(sscanf(params,"u",idx)) return SendClientMessage(playerid,-1,"use /ir [playerid]");
250
	    if(!IsPlayerConnected(idx)) return SendClientMessage(playerid,-1,"Jogador off-line");
251
	    format(string_,70,"O administrador %s lhe foi a sua posição.",nome);
252
	    GetPlayerPos(idx,c[0],c[1],c[2]);
253
	    if(GetPlayerState(playerid) == 2) return SetVehiclePos(playerid,c[0],c[1],c[2]);
254
	    SendClientMessage(idx,-1,string_);
255
	    SetPlayerPos(playerid,c[0],c[1],c[2]);
256
	}
257
	else return SendClientMessage(playerid,fail,NAOADM);
258
	return 1;
259
}
260
//------------------------------------------------------------------------------
261
CMD:daradmin(playerid,params[])
262
{
263
	if(info[playerid][pAdmin] >= 5)
264
	{
265
	    new
266
			idx,
267
			lvl;
268
		format(str,65,"o admin %s deu admin nivel %d para você.",PlayerName(playerid),lvl);
269
		GetPlayerName(playerid,nome,24);
270
		if(sscanf(params,"ud",idx,lvl)) SendClientMessage(playerid,-1,"use /daradmin [id] [level]");
271
		if(!fexist(arquivo)) return DOF2_CreateFile(arquivo),salvardados(playerid);
272
		if(!IsPlayerConnected(idx)) return SendClientMessage(playerid,-1,"Jogador off-line");
273
		if(lvl < 1 || lvl > 6) SendClientMessage(playerid,-1,"use somente de 1 - 5 ");
274
		info[idx][pAdmin] = lvl;
275
	 	salvardados(idx);
276
	}
277
	else SendClientMessage(playerid,-1,NAOADM);
278
	return 1;
279
}
280
//------------------------------------------------------------------------------
281
CMD:setarniveldetodos(playerid,params[])
282
{
283
	if(info[playerid][pAdmin] >= 1)
284
	{
285
	    new
286
	        nivel
287
		;
288
		if(sscanf(params,"d",nivel)) return SendClientMessage(playerid,verde,"use /setarniveldetodos [nivel]");
289
		format(string_,50,"Todos os jogadores ganharam nível %d",nivel);
290
		paramount(i,MAX_PLAYERS) return SetPlayerScore(i,nivel),SendClientMessage(i,-1,string_);
291
	}
292
	else return SendClientMessage(playerid,fail,NAOADM);
293
	return 1;
294
}
295
//------------------------------------------------------------------------------
296
CMD:viraradmin(playerid,params[])
297
{
298
	if(!IsPlayerAdmin(playerid)) return 1;
299
	GetPlayerName(playerid,nome,24);
300
	format(arquivo,sizeof(arquivo),adm,nome);
301
	DOF2_CreateFile(arquivo);
302
	info[playerid][pAdmin] = 5;
303
	salvardados(playerid);
304
	return 1;
305
}
306
//------------------------------------------------------------------------------
307
CMD:gmx(playerid,params[])
308
{
309
    if(info[playerid][pAdmin] >= 1)
310
    {
311
		format(string_,51,"O administrador %s deu GMX",PlayerName(playerid));
312
		SendClientMessageToAll(-1,string_);
313
		paramount(i,MAX_PLAYERS) salvardados(i);
314
		return SendRconCommand("gmx");
315
	}
316
	else SendClientMessage(playerid,-1,NAOADM);
317
	return 1;
318
}
319
//------------------------------------------------------------------------------
320
CMD:banir(playerid,params[])
321
{
322
    if(info[playerid][pAdmin] >= 1)
323
	{
324
	    new
325
		 	idx;
326
		if(sscanf(params,"us",idx,str)) return SendClientMessage(playerid,-1,"Use /banir (id)");
327
		if(!IsPlayerConnected(idx)) return SendClientMessage(playerid,-1,"jogador off-line");
328
		format(string_,70,"O jogador %s foi banido do servidor motivo: %s", PlayerName(idx),str);
329
	    SendClientMessageToAll(0xFF0000FF,string_);
330
		format(arquivo,sizeof(arquivo),adm,PlayerName(idx));
331
		DOF2_RemoveFile(arquivo);
332
		format(arquivo,sizeof(arquivo),banido,PlayerName(idx));
333
		DOF2_CreateFile(arquivo);
334
		info[idx][pBan] = 1;
335
		Ban(idx);
336
	}
337
	else SendClientMessage(playerid,-1,NAOADM);
338
	return 1;
339
}
340
//------------------------------------------------------------------------------
341
CMD:kick(playerid,params[])
342
{
343
    if(info[playerid][pAdmin] >= 1)
344
	{
345
	    new
346
		 	idx;
347
		if(sscanf(params,"us",idx,str)) return SendClientMessage(playerid,-1,"Use /kick (id)");
348
		if(!IsPlayerConnected(idx)) return SendClientMessage(playerid,-1,"jogador off-line");
349
		format(string_,70,"O jogador %s foi chutado do servidor motivo: %s", PlayerName(idx),str);
350
	    SendClientMessageToAll(0xFF0000FF,string_);
351
		Kick(idx);
352
	}
353
	else SendClientMessage(playerid,-1,NAOADM);
354
	return 1;
355
}
356
//------------------------------------------------------------------------------
357
CMD:calar(playerid,params[])
358
{
359
	if(info[playerid][pAdmin] >= 2)
360
	{
361
	    new
362
	        idx;
363
		if(sscanf(params,"u",idx)) return SendClientMessage(playerid,verde,"/calar [id/ou nome do individuo] ");
364
		calado[idx] = true;
365
		SendClientMessage(playerid,verde,"individuo calado com sucesso.");
366
		SendClientMessage(idx,fail,"foi calado pelo admin seu noob, cala boca um pouco!");
367
	}
368
	else return SendClientMessage(playerid,fail,NAOADM);
369
	return 1;
370
}
371
//------------------------------------------------------------------------------
372
CMD:descalar(playerid,params[])
373
{
374
	if(info[playerid][pAdmin] >= 2)
375
	{
376
	    new
377
	        idx
378
		;
379
		if(sscanf(params,"u",idx)) return SendClientMessage(playerid,verde,"/calar [id/ou nome do individuo] ");
380
		calado[idx] = false;
381
		SendClientMessage(playerid,verde,"individuo descalado com sucesso.");
382
		SendClientMessage(idx,fail,"foi descalado pelo admin!");
383
	}
384
	else return SendClientMessage(playerid,fail,NAOADM);
385
	return 1;
386
}
387
//------------------------------------------------------------------------------
388
CMD:setarhora(playerid,params[])
389
{
390
	if(info[playerid][pAdmin] >= 1)
391
	{
392
	    new
393
	        hora
394
		;
395
		if(sscanf(params,"d",hora)) return SendClientMessage(playerid,verde,"use /setarhora [Hora]");
396
		SetWorldTime(hora);
397
		SendClientMessageToAll(fail,"O ADMINISTRADOR AJUSTOU A HORA.");
398
	}
399
	else return SendClientMessage(playerid,fail,NAOADM);
400
	return 1;
401
}
402
//------------------------------------------------------------------------------
403
CMD:setarmundo(playerid,params[])
404
{
405
	if(info[playerid][pAdmin] >= 1)
406
	{
407
	    new
408
	        idx,
409
	        mundo;
410
		if(sscanf(params,"ud",idx,mundo)) return SendClientMessage(playerid,verde,"use /setarmundo [idx] [mundo]");
411
		SetPlayerVirtualWorld(idx,mundo);
412
		SendClientMessage(idx,fail,"o administrador mudou seu mundo virtual.");
413
	}
414
	else return SendClientMessage(playerid,fail,NAOADM);
415
	return 1;
416
}
417
//------------------------------------------------------------------------------
418
CMD:setarinterior(playerid,params[])
419
{
420
	if(info[playerid][pAdmin] >= 1)
421
	{
422
	    new
423
	        idx,
424
			interior;
425
		if(sscanf(params,"ud",idx,interior)) return SendClientMessage(playerid,verde,"use /setarmundo [idx][int]");
426
		SetPlayerInterior(idx,interior);
427
		SendClientMessage(idx,fail,"o administrador mudou seu mundo virtual.");
428
	}
429
	else return SendClientMessage(playerid,fail,NAOADM);
430
	return 1;
431
}
432
//------------------------------------------------------------------------------
433
CMD:repararcarro(playerid,params[])
434
{
435
	if(info[playerid][pAdmin] >= 1) return RepairVehicle(GetPlayerVehicleID(playerid));
436
	else return SendClientMessage(playerid,fail,NAOADM);
437
}
438
//------------------------------------------------------------------------------
439
CMD:desarmartodos(playerid,params[])
440
{
441
	if(info[playerid][pAdmin] >= 1)
442
	{
443
	    format(string_,72,"O administrador %s desarmou todos os jogadores.",PlayerName(playerid));
444
		paramount(i,MAX_PLAYERS) return ResetPlayerWeapons(i);
445
		SendClientMessageToAll(fail,string_);
446
	}
447
	else return SendClientMessage(playerid,fail,NAOADM);
448
	return 1;
449
}
450
//------------------------------------------------------------------------------
451
CMD:darcoleteall(playerid,params[])
452
{
453
    format(string_,78,"O administrador %s deu colete todos os jogadores.",PlayerName(playerid));
454
	if(info[playerid][pAdmin] >= 1)
455
	{
456
		paramount(i,MAX_PLAYERS) return SetPlayerArmour(i,100.0);
457
	}
458
	else return SendClientMessage(playerid,fail,NAOADM);
459
	return 1;
460
}
461
//------------------------------------------------------------------------------
462
CMD:darvidaall(playerid,params[])
463
{
464
    SendClientMessageToAll(fail,"o administrador deu vida 100 a todos os jogadores.");
465
	if(info[playerid][pAdmin] >= 1)
466
	{
467
		paramount(i,MAX_PLAYERS) return SetPlayerHealth(i,100.0);
468
	}
469
	else return SendClientMessage(playerid,fail,NAOADM);
470
	return 1;
471
}
472
//------------------------------------------------------------------------------
473
CMD:aviso(playerid,params[])
474
{
475
	if(info[playerid][pAdmin] >= 1)
476
	{
477
	    new
478
	        texto[128];
479
		GetPlayerName(playerid,nome,24);
480
		if(sscanf(params,"s[128]",texto)) return SendClientMessage(playerid,verde,"use /aviso [texto]");
481
		format(string_,70,"Aviso do admin %s: %s",PlayerName(playerid),texto);
482
		SendClientMessageToAll(verde,string_);
483
	}
484
	else return SendClientMessage(playerid,fail,NAOADM);
485
	return 1;
486
}
487
//------------------------------------------------------------------------------
488
CMD:tapa(playerid,params[])
489
{
490
	if(info[playerid][pAdmin] >= 1)
491
	{
492
	    new
493
	        idx,
494
	        Float:c[3]
495
		;
496
		if(sscanf(params,"u",idx)) return SendClientMessage(playerid,verde,"use /tapa [id]");
497
		GetPlayerPos(idx,c[0],c[1],c[2]);
498
		SetPlayerPos(idx,c[0],c[1],c[2]+15);
499
		format(string_,72,"%s levou um tapa do administrador %s",PlayerName(idx),PlayerName(playerid));
500
		SendClientMessageToAll(fail,string_);
501
	}
502
	else return SendClientMessage(playerid,fail,NAOADM);
503
	return 1;
504
}
505
//------------------------------------------------------------------------------
506
CMD:ejetardoveiculo(playerid,params[])
507
{
508
	if(info[playerid][pAdmin] >= 1)
509
	{
510
	    new
511
	        idx
512
		;
513
		if(sscanf(params,"u",idx)) return SendClientMessage(playerid,verde,"use /ejetardoveiculo [id]");
514
		RemovePlayerFromVehicle(idx);
515
		SendClientMessage(playerid,verde,"jogador removido do veiculo com sucesso.");
516
		SendClientMessage(idx,verde,"foi removido do carro.");
517
	}
518
	else return SendClientMessage(playerid,fail,NAOADM);
519
	return 1;
520
}
521
//------------------------------------------------------------------------------
522
CMD:nomeserver(playerid,params[])
523
{
524
	if(info[playerid][pAdmin] >= 1)
525
	{
526
	    new
527
	        nomeserver[50];
528
		if(sscanf(params,"s[128]",nomeserver)) return SendClientMessage(playerid,verde,"use /nomeserver [nome]");
529
		format(str,sizeof(str),"hostname %s",nomeserver);
530
		SendRconCommand(str);
531
	}
532
	else return SendClientMessage(playerid,fail,NAOADM);
533
	return 1;
534
}
535
//------------------------------------------------------------------------------
536
CMD:a(playerid,params[])
537
{
538
	if(info[playerid][pAdmin] >= 1)
539
	{
540
	    new
541
	        texto[128];
542
		if(sscanf(params,"s[128]",texto)) return SendClientMessage(playerid,verde,"use /a [texto]");
543
		GetPlayerName(playerid,nome,24);
544
		format(string_,80,"%s: %s",PlayerName(playerid),texto);
545
		paramount(i,MAX_PLAYERS)
546
		{
547
			if(info[playerid][pAdmin] >= 1) return SendClientMessageToAll(i,string_);
548
		}
549
	}
550
	else return SendClientMessage(playerid,fail,NAOADM);
551
	return 1;
552
}
553
//------------------------------------------------------------------------------
554
CMD:matarall(playerid,params[])
555
{
556
	if(info[playerid][pAdmin] >= 1)
557
	{
558
	    paramount(i,MAX_PLAYERS) return SetPlayerHealth(i,0.0);
559
	}
560
	else return SendClientMessage(playerid,fail,NAOADM);
561
	return 1;
562
}
563
//------------------------------------------------------------------------------
564
CMD:fakeban(playerid,params[])
565
{
566
	if(info[playerid][pAdmin] >= 1)
567
	{
568
		new
569
		    idx,
570
		    motivo[120];
571
		if(sscanf(params,"us[128]",idx,motivo)) return SendClientMessage(playerid,verde,"/fakeban [id] [motivo]");
572
		format(str,sizeof(str),"%s foi banido do servidor motivo : %s",PlayerName(playerid),motivo);
573
		SendClientMessageToAll(fail,str);
574
		SendClientMessage(idx,0x808080FF,"Server closed the connection");
575
	}
576
	else return SendClientMessage(playerid,fail,NAOADM);
577
	return 1;
578
}
579
//------------------------------------------------------------------------------
580
CMD:darvida(playerid,params[])
581
{
582
	if(info[playerid][pAdmin] >= 1)
583
	{
584
		new
585
		    Float:hp,
586
		    idx
587
		;
588
		if(sscanf(params,"uf",idx,hp)) return SendClientMessage(playerid,verde,"/darvida [playerid] [qtd]");
589
		if(hp > 100) return SendClientMessage(playerid,fail,"0-100.");
590
		SetPlayerHealth(idx,GetPlayerHealth(playerid,hp)+hp);
591
		SendClientMessage(idx,verde,"Ganhou vida do administrador.");
592
		SendClientMessage(playerid,verde,"Vida dada com sucesso.");
593
	}
594
	else return SendClientMessage(playerid,fail,NAOADM);
595
	return 1;
596
}
597
//------------------------------------------------------------------------------
598
CMD:dararma(playerid,params[])
599
{
600
	if(info[playerid][pAdmin] >= 1)
601
	{
602
	    new
603
	        arma,
604
	        idx,
605
	        municao
606
		;
607
		if(sscanf(params,"udd",idx,arma,municao)) return SendClientMessage(playerid,verde,"use /dararma [id] [arma] [muniçao]");
608
		if(arma < 1 || arma > 48) return SendClientMessage(playerid,fail,"use de 1-48");
609
		GivePlayerWeapon(idx,arma,municao);
610
		SendClientMessage(idx,verde,"ganhou armas do administrador.");
611
        SendClientMessage(playerid,verde,"Armas dadas com sucesso.");
612
	}
613
	else return SendClientMessage(playerid,fail,NAOADM);
614
	return 1;
615
}
616
//------------------------------------------------------------------------------
617
CMD:resetararmas(playerid,params[])
618
{
619
	if(info[playerid][pAdmin] >= 1)
620
	{
621
	    new
622
	        idx
623
		;
624
		if(sscanf(params,"u",idx)) return SendClientMessage(playerid,verde,"use /resetararmas [id]");
625
		ResetPlayerWeapons(idx);
626
		SendClientMessage(playerid,verde,"Armas resetadas com sucesso.");
627
		SendClientMessage(playerid,fail,"O admin resetou suas armas.");
628
	}
629
	else return SendClientMessage(playerid,fail,NAOADM);
630
	return 1;
631
}
632
//------------------------------------------------------------------------------
633
CMD:setarvida(playerid,params[])
634
{
635
	if(info[playerid][pAdmin] >= 1)
636
	{
637
	    new
638
	        Float:vida,
639
	        idx
640
		;
641
		if(sscanf(params,"uf",idx,vida)) return SendClientMessage(playerid,verde,"use /setarvida [playerid] [qtd]");
642
		if(vida > 100) return SendClientMessage(playerid,fail,"0-100.");
643
		SetPlayerHealth(idx,vida);
644
		SendClientMessage(playerid,-1,"vida setada com sucesso.");
645
		SendClientMessage(idx,-1,"sua vida foi setada pelo administrador.");
646
	}
647
	else return SendClientMessage(playerid,fail,NAOADM);
648
	return 1;
649
}
650
//------------------------------------------------------------------------------
651
CMD:darcolete(playerid,params[])
652
{
653
	if(info[playerid][pAdmin] >= 1)
654
	{
655
	    new
656
	        Float:colete,
657
	        idx;
658
		format(string_,sizeof(string_),"O admin %s lhe deu %f de colete.",PlayerName(playerid),colete);
659
		if(sscanf(params,"uf",idx,colete)) return SendClientMessage(playerid,verde,"use /darcolete [playerid] [qtd]");
660
		GivePlayerArmour(playerid,colete);
661
		SendClientMessage(playerid,-1,"colete dado com sucesso.");
662
		SendClientMessage(idx,-1,string_);
663
	}
664
	else return SendClientMessage(playerid,fail,NAOADM);
665
	return 1;
666
}
667
//------------------------------------------------------------------------------
668
CMD:pegarip(playerid,params[])
669
{
670
	if(info[playerid][pAdmin] >= 1)
671
	{
672
	    new
673
	        idx;
674
		if(sscanf(params,"u",idx)) return SendClientMessage(playerid,verde,"/pegarip [id]");
675
		GetPlayerIp(idx,ip,16);
676
		format(string_,sizeof(string_),"ip de %s: %s",PlayerName(playerid),ip);
677
		SendClientMessage(playerid,verde,string_);
678
	}
679
	else return SendClientMessage(playerid,fail,NAOADM);
680
	return 1;
681
}
682
//------------------------------------------------------------------------------
683
CMD:setarcolete(playerid,params[])
684
{
685
	if(info[playerid][pAdmin] >= 1)
686
	{
687
	    new
688
	        Float:colete,
689
	        idx
690
		;
691
		if(sscanf(params,"uf",idx,colete)) return SendClientMessage(playerid,verde,"use /setarcolete [playerid] [qtd]");
692
		SetPlayerArmour(idx,colete);
693
		SendClientMessage(playerid,-1,"colete dado com sucesso.");
694
		SendClientMessage(idx,-1,"ganhou colete do administrador.");
695
	}
696
	else return SendClientMessage(playerid,fail,NAOADM);
697
	return 1;
698
}
699
//------------------------------------------------------------------------------
700
CMD:aa(playerid,params[])
701
{
702
	if(info[playerid][pAdmin] >= 1) return SendClientMessage(playerid,fail,"/banir /kickar /congelar /renascer /limparchat /descongelar /setargrana /dargrana"),SendClientMessage(playerid,-1,"/darvida /darcolete /setarvida /setarcolete /darcolete /trazertodos /kickartodos"),SendClientMessage(playerid,-1,"/sim /nao /votacao /encerrar");
703
	return 1;
704
}
705
//------------------------------------------------------------------------------
706
CMD:limparchat(playerid,params[])
707
{
708
	if(info[playerid][pAdmin] >= 1)
709
	{
710
		new
711
		    linhas
712
		;
713
		if(sscanf(params,"i",linhas)) return SendClientMessage(playerid,fail,"use /limparchat [linhas]");
714
		for(new ii = 0; ii < linhas; ii++) SendClientMessage(playerid, -1, "");
715
	}
716
	else return SendClientMessage(playerid,fail,NAOADM);
717
	return 1;
718
}
719
//------------------------------------------------------------------------------
720
CMD:descongelar(playerid,params[])
721
{
722
    if(info[playerid][pAdmin] >= 1)
723
    {
724
  		new
725
		  idx;
726
		format(string_,67,"O jogador %s foi descongelado pelo admin %s",PlayerName(idx),PlayerName(playerid));
727
		if(sscanf(params,"u",idx)) return SendClientMessage(playerid,-1,"Use /descongelar [playerid]");
728
		if(!IsPlayerConnected(idx)) return SendClientMessage(playerid,-1,"jogador off-line");
729
		Controle(idx,1);
730
		SendClientMessage(idx,-1,"Descongelado com sucesso!");
731
	}
732
	else SendClientMessage(playerid,-1,NAOADM);
733
	return 1;
734
}
735
//------------------------------------------------------------------------------
736
CMD:espiar(playerid,params[])
737
{
738
	if(info[playerid][pAdmin] >= 1)
739
	{
740
	    new
741
	        idx;
742
		if(espiando[playerid] == false)
743
		{
744
			GetPlayerName(playerid,nome,24);
745
			if(sscanf(params,"u",idx)) return SendClientMessage(playerid,-1,"use /espiar [playerid]");
746
			TogglePlayerSpectating(playerid, 1);
747
			PlayerSpectatePlayer(playerid,idx);
748
			format(string_,60,"Você está espiando o jogador %s (ID : %d )",nome,playerid);
749
			SendClientMessage(playerid,-1,string_);
750
			return espiando[playerid] = true;
751
		}
752
		else return SendClientMessage(playerid,fail,NAOADM);
753
	}
754
	else return SendClientMessage(playerid,fail,NAOADM);
755
}
756
//------------------------------------------------------------------------------
757
CMD:parardeespiar(playerid,params[])
758
{
759
	if(info[playerid][pAdmin] >= 1)
760
	{
761
	    espiando[playerid] = false;
762
		TogglePlayerSpectating(playerid,0);
763
		return SpawnPlayer(playerid);
764
	}
765
	else return SendClientMessage(playerid,fail,NAOADM);
766
}
767
//------------------------------------------------------------------------------
768
CMD:congelar(playerid,params[])
769
{
770
	if(info[playerid][pAdmin] >= 1)
771
	{
772
	    new
773
			idx;
774
		if(sscanf(params,"u",idx)) return SendClientMessage(playerid,-1,"Uso correto: /congelar [playerid]");
775
		if(!IsPlayerConnected(idx)) return SendClientMessage(playerid,-1,"Jogador off-line");
776
		format(string_,64,"O jogador %s foi congelado pelo admin %s",PlayerName(idx),PlayerName(playerid));
777
		SendClientMessageToAll(0xFFFF00AA,string_);
778
		SendClientMessage(idx,-1,"Você foi congelado champz");
779
		SendClientMessage(playerid,-1,"Você congelou um jogador com sucesso");
780
		Controle(idx,0);
781
	}
782
	else SendClientMessage(playerid,-1,NAOADM);
783
	return 1;
784
}
785
//------------------------------------------------------------------------------
786
CMD:dargrana(playerid,params[])
787
{
788
	if(info[playerid][pAdmin] >= 2)
789
	{
790
		new
791
			quantia,
792
			idx
793
		;
794
		if(sscanf(params,"ud",idx,quantia)) return SendClientMessage(playerid,-1,"use /dargrana [playerid] [quantia]");
795
		if(!IsPlayerConnected(idx)) return SendClientMessage(playerid,-1,"Jogador off-line");
796
		GivePlayerMoney(idx,quantia);
797
		SendClientMessage(playerid,-1,"quantia dada com sucesso.");
798
	}
799
	else SendClientMessage(playerid,-1,NAOADM);
800
	return 1;
801
}
802
//------------------------------------------------------------------------------
803
CMD:relatorio(playerid,params[])
804
{
805
	new
806
	    texto[129]
807
	;
808
	GetPlayerName(playerid,nome,24);
809
	if(sscanf(params,"s",texto)) return SendClientMessage(playerid,-1,"use /relatorio [texto]");
810
	format(string_,sizeof(string_),"Relatório de %s: %s",nome,texto);
811
	SendAdminMessage(string_);
812
	return 1;
813
}
814
//------------------------------------------------------------------------------
815
CMD:par(playerid,params[])
816
{
817
	if(info[playerid][pAdmin] >= 1)
818
	{
819
		new
820
		    texto[128],
821
		    idx;
822
	 	GetPlayerName(playerid,nome,24);
823
		if(sscanf(params,"us",idx,texto)) return SendClientMessage(playerid,-1,"use /relatorio [playerid] [texto]");
824
		if(!IsPlayerConnected(idx)) return SendClientMessage(playerid,-1,"Jogador Off-line.");
825
		format(string_,sizeof(string_),"Mp do admin %s: %s",nome,texto);
826
		SendClientMessage(playerid,verde,string_);
827
	}
828
	else return SendClientMessage(playerid,fail,NAOADM);
829
	return 1;
830
}
831
//------------------------------------------------------------------------------
832
CMD:admins(playerid,params[])
833
{
834
	SendClientMessage(playerid,verde,"Administradores On-line");
835
	paramount(i,MAX_PLAYERS)
836
	{
837
	    GetPlayerName(i,nome,24);
838
	    if(info[i][pAdmin] >= 1)
839
		{
840
			format(string_,100,"%s",nome);
841
			SendClientMessage(playerid,verde,string_);
842
		}
843
	}
844
	return 1;
845
}
846
//------------------------------------------------------------------------------
847
CMD:autorizar(playerid,params[])
848
{
849
	if(info[playerid][pAdmin] >= 1)
850
	{
851
	    new
852
	        idx;
853
	    if(sscanf(params,"u",idx)) return SendClientMessage(playerid,verde,"/autorizar [playerid]");
854
	    if(!IsPlayerConnected(idx)) return SendClientMessage(playerid,-1,"Jogador Off-line.");
855
	    info[idx][pAutorizado] = 1;
856
	    SendClientMessage(idx,verde,"foi autorizado a mudar de nick.");
857
	}
858
	else return SendClientMessage(playerid,fail,NAOADM);
859
	return 1;
860
}
861
//------------------------------------------------------------------------------
862
CMD:mudarnick(playerid,params[])
863
{
864
	if(info[playerid][pAutorizado] == 1)
865
	{
866
		if(sscanf(params,"s[24]",string_)) return SendClientMessage(playerid,verde,"use /mudarnick [nome_novo]");
867
		SetPlayerName(playerid,string_);
868
		SendClientMessage(playerid,verde,"nick alterado com sucesso.");
869
		info[playerid][pAutorizado] = 0;
870
	}
871
	else return SendClientMessage(playerid,verde,"não está autorizado.");
872
	return 1;
873
}
874
//------------------------------------------------------------------------------
875
CMD:mudarskin(playerid,params[])
876
{
877
	if(info[playerid][pAdmin] >= 1)
878
	{
879
	    new
880
	        idx,
881
	        skinid;
882
		if(sscanf(params,"ud",idx,skinid)) return SendClientMessage(playerid,-1,"use /mudarskin [playerid] [skinid]");
883
		if(!IsPlayerConnected(idx)) return SendClientMessage(playerid,-1,"Jogador Off-line.");
884
		if(skinid < 0 || skinid > 299) return SendClientMessage(playerid,-1,"use de 0-299");
885
		SetPlayerSkin(idx,skinid);
886
		SendClientMessage(playerid,-1,"Você setou uma skin com sucesso.");
887
		SendClientMessage(playerid,-1,"O administrador mudou sua skin.");
888
	}
889
	else return SendClientMessage(playerid,fail,NAOADM);
890
	return 1;
891
}
892
//------------------------------------------------------------------------------
893
public OnPlayerConnect(playerid)
894
{
895
	if(info[playerid][pBan] == 1)
896
	{
897
	    GetPlayerIp(playerid,ip,16);
898
	    GetPlayerName(playerid,nome,24);
899
	    format(string_,sizeof(string_),"Olá %s, você não pode mais jogar aqui pois foi banido\n\n\tIP:%s",nome,ip);
900
	    ShowPlayerDialog(playerid,9999,DIALOG_STYLE_LIST,"Banido",string_,"Ok","");
901
	}
902
	return 1;
903
}
904
905
//------------------------------------------------------------------------------
906
public OnPlayerDisconnect(playerid)
907
{
908
	salvardados(playerid);
909
	return 1;
910
}
911
//------------------------------------------------------------------------------
912
public OnFilterScriptInit()
913
{
914
	print("Sistema de Administração by Paramount carregado com sucesso.");
915
	SendClientMessageToAll(verde,"Paramount ADM system carregado com sucesso.");
916
	return 1;
917
}
918
//------------------------------------------------------------------------------
919
public OnFilterScriptExit()
920
{
921
	DOF2_Exit();
922
	paramount(i,MAX_PLAYERS) return salvardados(i);
923
	return 1;
924
}
925
//------------------------------------------------------------------------------
926
public OnPlayerText(playerid,text[])
927
{
928
	if(calado[playerid] == true)
929
	{
930
		SendClientMessage(playerid,fail,"foi calado , tenta fala agora seu noob.");
931
		return 0;
932
	}
933
	return 1;
934
}
935
//------------------------------------------------------------------------------
936
stock SetPlayerMoney(id,dinheiro)
937
{
938
	ResetPlayerMoney(id);
939
 	return GivePlayerMoney(id,dinheiro);
940
}
941
//------------------------------------------------------------------------------
942
stock PlayerName(id)
943
{
944
	new name[MAX_PLAYER_NAME];
945
	GetPlayerName(id, name, sizeof(name));
946
	return name;
947
}
948
//------------------------------------------------------------------------------
949
stock salvardados(playerid)
950
{
951
	GetPlayerName(playerid,nome,24);
952
	format(arquivo,sizeof(arquivo),adm,nome);
953
	DOF2_SetInt(arquivo,"admin",info[playerid][pAdmin]);
954
	DOF2_SetInt(arquivo,"autorizado",info[playerid][pAutorizado]);
955
	DOF2_SetInt(arquivo,"banido",info[playerid][pBan]);
956
	DOF2_SaveFile();
957
	return 1;
958
}
959
//------------------------------------------------------------------------------
960
stock carregardados(playerid)
961
{
962
	GetPlayerName(playerid,nome,24);
963
	info[playerid][pAdmin] = DOF2_GetInt(arquivo,"admin");
964
	info[playerid][pAutorizado] = DOF2_GetInt(arquivo,"autorizado");
965
	info[playerid][pBan] = DOF2_GetInt(arquivo,"banido");
966
	return 1;
967
}
968
//------------------------------------------------------------------------------
969
stock GivePlayerArmour(playerid,Float:colete)
970
{
971
	new
972
		Float:oldcolete;
973
	GetPlayerArmour(playerid,oldcolete);
974
	return SetPlayerArmour(playerid,oldcolete+colete);
975
}
976
//------------------------------------------------------------------------------
977
stock SendAdminMessage(const texto[])
978
{
979
	paramount(i,MAX_PLAYERS)
980
	{
981
		if(info[i][pAdmin]) return SendClientMessage(i,verde,texto);
982
	}
983
	return 1;
984
}
985
//------------------------------------------------------------------------------
986
/* COMANDOS DO PARAMOUNT ADMIN SYS
987
988
/mudarskin
989
/mudarnick
990
/autorizar
991
/kickar
992
/banir
993
/kickartodos
994
/trazertodos
995
/admins
996
/par
997
/relatorio
998
/dargrana
999
/setargrana
1000
/darvida
1001
/setarvida
1002
/darcolete
1003
/setarcolete
1004
/congelar
1005
/descongelar
1006
/limparchat
1007
/gmx
1008
/daradmin
1009
/ir
1010
/trazer
1011
/darnivel
1012
/setarspawn
1013
/votacao
1014
/sim
1015
/nao
1016
/pegarip
1017
/calar
1018
/descalar
1019
/encerrar
1020
/setarhora
1021
/setarmundo
1022
/setarinterior
1023
/aviso
1024
/fakeban
1025
/matarall
1026
/darvidaall
1027
/darcoleteall
1028
/repararcarro
1029
/a [ admin chat ]
1030
/desarmartodos
1031
/desarmar
1032
/viraradmin
1033
/setarniveldetodos
1034
/tapa
1035
/ejetardoveiculo
1036
/nomeserver
1037
/espiar
1038
/parardeespiar
1039-
*/
1039+
*/
1040