Animações
//---------------------ANIMAÇÕES---------------------------------------------
if(strcmp("/renderse", cmd, true) == 0)
{
SetPlayerSpecialAction(playerid, 10);
return 1;
}
if(strcmp("/ligar", cmd, true) == 0)
{
SetPlayerSpecialAction(playerid, 11);
return 1;
}
if(strcmp("/desligar", cmd, true) == 0)
{
SetPlayerSpecialAction(playerid, 13);
return 1;
}
if(strcmp("/bebado", cmd, true) == 0)
{
ApplyAnimation(playerid, "PED", "WALK_DRUNK", 4.0, 1, 1, 1, 1, 0);
return 1;
}
if(strcmp("/bomba", cmd, true) == 0)
{
ClearAnimations(playerid);
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
return 1;
}
if(strcmp("/apontar", cmd, true) == 0)
{
ApplyAnimation(playerid, "ped", "ARRESTgun", 4.0, 0, 1, 1, 1, -1);
return 1;
}
if(strcmp("/merda", cmd, true) == 0)
{
ApplyAnimation(playerid, "RAPPING", "Laugh_01", 4.0, 0, 0, 0, 0, 0);
return 1;
}
if(strcmp("/mascararse", cmd, true) == 0)
{
ApplyAnimation(playerid, "SHOP", "ROB_Shifty", 4.0, 0, 0, 0, 0, 0);
return 1;
}
if(strcmp("/roubar", cmd, true) == 0)
{
ApplyAnimation(playerid, "SHOP", "ROB_Loop_Threat", 4.0, 1, 0, 0, 0, 0);
return 1;
}
if(strcmp("/cruzarb", cmd, true) == 0)
{
ApplyAnimation(playerid, "COP_AMBIENT", "Coplook_loop", 4.0, 0, 1, 1, 1, -1);
return 1;
}
if(strcmp("/deitar", cmd, true) == 0)
{
ApplyAnimation(playerid, "BEACH", "bather", 4.0, 1, 0, 0, 0, 0);
return 1;
}
if(strcmp("/abaixar", cmd, true) == 0)
{
ApplyAnimation(playerid, "ped", "cower", 3.0, 1, 0, 0, 0, 0);
return 1;
}
if(strcmp("/vomitar", cmd, true) == 0)
{
ApplyAnimation(playerid, "FOOD", "EAT_Vomit_P", 3.0, 0, 0, 0, 0, 0);
return 1;
}
if(strcmp("/comer", cmd, true) == 0)
{
ApplyAnimation(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0);
return 1;
}
if(strcmp("/rap", cmd, true) == 0)
{
ApplyAnimation(playerid, "ON_LOOKERS", "wave_loop", 4.0, 1, 0, 0, 0, 0);
return 1;
}
if(strcmp("/passaramao", cmd, true) == 0)
{
ApplyAnimation(playerid, "SWEET", "sweet_ass_slap", 4.0, 0, 0, 0, 0, 0);
return 1;
}
if(strcmp("/cobrar", cmd, true) == 0)
{
ApplyAnimation(playerid, "DEALER", "DEALER_DEAL", 4.0, 0, 0, 0, 0, 0);
return 1;
}
if(strcmp("/overdose", cmd, true) == 0)
{
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
return 1;
}
if(strcmp("/fumar", cmd, true) == 0)
{
ApplyAnimation(playerid, "SMOKING", "M_smklean_loop", 4.0, 1, 0, 0, 0, 0);
return 1;
}
if(strcmp("/fumar2", cmd, true) == 0)
{
ApplyAnimation(playerid, "SMOKING", "F_smklean_loop", 4.0, 1, 0, 0, 0, 0);
return 1;
}
if(strcmp("/sentar", cmd, true) == 0)
{
ApplyAnimation(playerid, "BEACH", "ParkSit_M_loop", 4.0, 1, 0, 0, 0, 0);
return 1;
}
if(strcmp("/conversar", cmd, true) == 0)
{
ApplyAnimation(playerid, "PED", "IDLE_CHAT", 4.0, 0, 0, 0, 0, 0);
return 1;
}
if(strcmp("/fodase", cmd, true) == 0)
{
ApplyAnimation(playerid, "PED", "fucku", 4.0, 0, 0, 0, 0, 0);
return 1;
}
if(strcmp("/taichi", cmd, true) == 0)
{
ApplyAnimation(playerid, "PARK", "Tai_Chi_Loop", 4.0, 1, 0, 0, 0, 0);
return 1;
}
if(strcmp("/observar", cmd, true) == 0)
{
ApplyAnimation(playerid, "BAR", "dnk_stndF_loop", 4.0, 1, 0, 0, 0, 0);
return 1;
}
//---------------------Lista Animações------------------------------------
if(strcmp("/animes", cmd, true) == 0)
{
SendClientMessage(playerid, ADMINFS_MESSAGE_COLOR, "[DraKoN's Server]:Lista de Animes :");
SendClientMessage(playerid, ADMINFS_MESSAGE_COLOR, "/renderse /ligar /desligar /bebado /bomba /apontar /merda /mascararse");
SendClientMessage(playerid, ADMINFS_MESSAGE_COLOR, "/roubar /cruzarb /deitar /abaixar /vomitar /comer /rap /passaramao");
SendClientMessage(playerid, ADMINFS_MESSAGE_COLOR, "/cobrar /overdose /fumar /fumar2 /sentar /conversar /fodase /taichi");
SendClientMessage(playerid, ADMINFS_MESSAGE_COLOR, "/observar ");
return 1;
}
Mostrando postagens mais recentes com o marcador Códigos. Mostrar postagens mais antigas Mostrando postagens mais recentes com o marcador Códigos. Mostrar postagens mais antigas16
Jun [COD]Expulsar Passageiro
Este codigo expulsa somente o passageiro.
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd, "/expulsar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new State;
if(IsPlayerInAnyVehicle(playerid))
{
State=GetPlayerState(playerid);
if(State!=PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid,Vermelho," Voce nao e o motorista do carro !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, Vermelho, "Use: /expulsar [ id ]");
return 1;
}
new playa;
playa = ReturnUser(tmp);
new test;
test = GetPlayerVehicleID(playerid);
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
if(playa == playerid) { SendClientMessage(playerid, Vermelho, "Voce nao pode se expulsar."); return 1; }
if(IsPlayerInVehicle(playa,test))
{
new PName[MAX_PLAYER_NAME];
GetPlayerName(playerid,PName,sizeof(PName));
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* Voce expulso o(a) %s para fora do carro!", giveplayer);
SendClientMessage(playerid, Azul_Escuro, string);
format(string, sizeof(string), "* Voce foi retirado do carro por %s !", PName);
SendClientMessage(playa, Azul, string);
RemovePlayerFromVehicle(playa);
}
else
{
SendClientMessage(playerid, Vermelho, " Este jogador não está em seu carro !");
return 1;
}
}
}
else
{
SendClientMessage(playerid, Vermelho, " ID/Nick - Invalido!");
}
}
else
{
SendClientMessage(playerid, Vermelho, " Voce precisa estar em um carro para usar este comando !");
}
}
return 1;
}
Postado por GTA às 6/16/2010 0 comentários Links para esta postagem Marcadores: Códigos, Tutoriais 14
Jun [TUT]Teleporte por Dialog
Topo Do GM
new sendername[MAX_PLAYER_NAME];
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/pawnsamp", true) == 0)
{
ShowPlayerDialog(playerid, IDdoDialog,DIALOG_STYLE_LIST,"Teleportes","\n- Ps - \n- Ps2 -","Ok","Sair");
return 1;
}public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == IDdoDialog)
{
if(response)
{
if(listitem == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid), CORDENADAS DO TELEPORTE);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 266.6323);
LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
}
else
{
SetPlayerPos(playerid, CORDENADAS);
}
TogglePlayerControllable(playerid, 1);
SetPlayerInterior(playerid, 0);
ResetPlayerWeapons(playerid);
GetPlayerName(playerid, sendername, sizeof(sendername));
new string[256];
format(string, sizeof(string), "%s Foi para ps ! (/pawnsamp)", sendername);
SendClientMessageToAll(COR, string);
}
}
if(listitem == 1)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid), CORDENADAS DO TELEPORTE);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 266.6323);
LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
}
else
{
SetPlayerPos(playerid, CORDENADAS DO TELEPORTE);
}
TogglePlayerControllable(playerid, 1);
SetPlayerInterior(playerid, 0);
ResetPlayerWeapons(playerid);
GetPlayerName(playerid, sendername, sizeof(sendername));
new string[256];
format(string, sizeof(string), "%s Foi para ps2 ! (/pawnsamp)", sendername);
SendClientMessageToAll(COR, string);
}
}
Postado por GTA às 6/14/2010 2 comentários Links para esta postagem Marcadores: Códigos, Tutoriais 04
Jun [COD/FS]Pintar Carro
public OnPlayerCommandText(playerid, cmdtext[])
{
//****** Pintar *******
if(strcmp(cmd, "/pintar", true) == 0)
{
new tmp[256];
new cor1, cor2;
new veiculo;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COR,"USE: /pintar [cor 1] [cor 2]");
return 1;
}
cor1 = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COR,"USE: /pintar [cor 1] [cor 2]");
return 1;
}
cor2 = strval(tmp);
veiculo = GetPlayerVehicleID(playerid);
if(IsPlayerInVehicle(playerid,veiculo))
{
ChangeVehicleColor(veiculo,cor1,cor2);
GivePlayerMoney(playerid,-100);
SendClientMessage(playerid,COR, "Veiculo pintador por $100!");
} else {
SendClientMessage(playerid,COR, "Você nao esta em um veiculo!");
}
return 1;
}
By GTA
Postado por GTA às 6/04/2010 0 comentários Links para esta postagem Marcadores: Códigos, Filter Scripts 31
Mai [FS/COD]Contar
//Topo do GM
new Contar;
forward Contar3(playerid);
forward Contar2(playerid);
forward Contar1(playerid);
forward Correr(playerid);
//public OnPlayerCommandText(playerid, cmdtext[])
if(strcmp(cmd, "/contar", true) == 0)
{
if (Contar == 1) return SendClientMessage(playerid, Vermelho, "Contagem em Progresso!");
GetPlayerName(playerid, sendername, sizeof(sendername));
new string[256];
format(string, sizeof(string), "%s Começou a contagem!", sendername);
Contar = 1;
SetTimerEx("Contar3", 500, false, "d", playerid);
SendClientMessageToAll(Amarelo, string);
return 1;
}
//Final do GM ( Bem no Final )
public Contar3(playerid)
{
SetTimerEx("Contar2", 1000, false, "d", playerid);
for(new i = 0; i < MAX_PLAYERS; i++)
{
PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
}
GameTextForAll("~b~[3]", 1500, 3);
return 1;
}
public Contar2(playerid)
{
SetTimerEx("Contar1", 1000, false, "d", playerid);
for(new i = 0; i < MAX_PLAYERS; i++)
{
PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
}
GameTextForAll("~b~[2]", 1500, 3);
return 1;
}
public Contar1(playerid)
{
SetTimerEx("Correr", 1000, false, "d", playerid);
for(new i = 0; i < MAX_PLAYERS; i++)
{
PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
}
GameTextForAll("~b~[1]", 1500, 3);
return 1;
}
public Correr(playerid)
{
Contar = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
}
GameTextForAll("~r~Go!Go!Go!", 1500, 3);
return 1;
}
By GTA
Postado por GTA às 5/31/2010 0 comentários Links para esta postagem Marcadores: Básicos, Códigos 23
Mai [TUT] Killing Spree (Armazenar em Variável)
Aqui um Breve TUTORIAL de como criar Killing Spree (Kills Seguidos)
Basicamente é uma variável que armazena o Kills Enquanto a Player é Conectado:
Topo GM:
new Matou[MAX_PLAYERS];
Em OnPlayerDeath:
new player[MAX_PLAYER_NAME], string[44];
Matou[killerid]++;
Matou[playerid]--;
GetPlayerName(killerid,player,sizeof(player));
if(Matou[killerid]==3){
format(string, sizeof (string), " %s ja matou 3 seguidos sem morrer",player);
SendClientMessageToAll(COR, str);
EXPLICAÇÃO:
new Matou[MAX_PLAYERS]; //variável que Armazena os Kills
Matou[playerid]--; //Irá Armazenar a variável '--' Menos ou seja ira diminuir
Matou[killerid]++;//Ira Adicionar '++' a variável do Killerid ou seja o player que matou
GetPlayerName(playerid,player,sizeof(player)); // Pega o nome para enviar String
if(Matou[killerid]==3) // Usá Comparador 'IF 'para ver se o player ja matou 3x seguido
format(string, // Formato da String que Enviaremos
SendClientMessageToAll(COR, str);//Enviara a MSG contendo a string
Tutorial Criado por DraKoN, permitido a publicação apenas com autorização do mesmo
Postado por AdminDraKoN às 5/23/2010 0 comentários Links para esta postagem Marcadores: Códigos, Tutoriais 20
Mai [TUT/COD] Animação Antes de Morrer
Criar um Timer que verifica a vida do player caso seja menos de 5 (antes de morrer) ele ira aplicar um animação vejamos:
Facil,
Topo GM: (Abaixo de OnGameModeInit)
SetTimer("MACHO",1000,true);//COMECA ATUALIZAR PLAYER
forward MACHO(playerid);//DEFINE A PUBLIC ADICIONAL 'MACHO'Final do GM:(ULTIMA LINHA)public MACHO(playerid)//PUBLIC
{
new Float:MACHOVIDA;//DEFINE
GetPlayerHealth(playerid,MACHOVIDA);//PEGA VIDA
if (MACHOVIDA< class="Apple-style-span" color="#009900">//SE FOR MENOR QUE 5
{
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);//APLICA ANIM
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);//APLICA ANIM TogglePlayerControllable(playerid,0);//CONGELA ELE
}
return 1;
}
__________________________________________________________________
EXPLICAÇÃO:
ApplyAnimation -> APLICA ANIM
TogglePlayerControllable -> CONGELA ELE
SetTimer -> COMECA ATUALIZAR PLAYER (CHECAR VIDA)
forward -> Define a Public Adicional
public MACHO -> Public Adicional
GetPlayerHealth -> Pega Vida player
if (MACHOVIDA -> SE FOR MENOR QUE 10
return -> Retorna a uma função, 1 / 0
Postado por AdminDraKoN às 5/20/2010 0 comentários Links para esta postagem Marcadores: Códigos 18
Mai [TUT/COD] Detectar ID do Carro
Para Você que não conhecia
GetVehicleModel
Então Lembrando
CarrosIDDKN -> Carros
MotosIDDKN -> Não São Carros
Bom Surgiu de uma dúvida de um membro la do fórum então venho aqui responder!
Exemplo:
Ao Entrar no Veiculo:
public OnPlayerEnterVehicle(playerid,vehicleid,ispassenger)
{
new CarrosIDDKN = 400
401
402
404
405
410
411
412
415
418
419
420
421
422
424
426
429
434
436
438
439
442
445
451
458
466
467
470
474
475
477
478
480
480
480
480
489
490
491
492
494
496
500
501
502
503
504
505
506
507
516
517
518
526
527
529
533
534
535
536
540
541
542
543
545
546
547
549
550
551
555
558
559
560
561
562
565
566
567
575
576
580
585
587
589
596
597
598
600
602
603
604
605 ;//ID DOS CARROS
if(GetVehicleModel(vehicleid) == CarrosIDDKN)
{
SendClientMessage(playerid, 0xFFFFFFFF, "Você Entrou em um Carro meu gostoso GAY");
}
return 1;
}Definições:
new CarrosIDDKN -> A própria 'new' que define os carros
411
520 -> ID CARROS(separador por '
'
OnPlayerEnterVehicle -> Ao Player Entrar ao Veículos
SendClientMessage -> Envia Mensagem ao Player
Em Comando Vamos la´:
if(strcmp("/cinto", cmdtext, true) == 0)
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
new CarrosIDDKN = 400
401
402
404
405
410
411
412
415
418
419
420
421
422
424
426
429
434
436
438
439
442
445
451
458
466
467
470
474
475
477
478
480
480
480
480
489
490
491
492
494
496
500
501
502
503
504
505
506
507
516
517
518
526
527
529
533
534
535
536
540
541
542
543
545
546
547
549
550
551
555
558
559
560
561
562
565
566
567
575
576
580
585
587
589
596
597
598
600
602
603
604
605 ;//ID DOS CARROS
if(GetVehicleModel(vehicleid) == CarrosIDDKN) return SendClientMessage(playerid, 0xFFFFFFFF, "Você não esta em um carro gostoso gay");
{
//AQUI CÓDIGO DO CINTO
}
return 1;
}if(strcmp("/cinto", cmdtext, true) == 0) -> Comando
new CarrosIDDKN = 509
510
522; -> ID DOS CARROs
new MotosIDDKN = 509
510
522; -> ID DAS MOTOS
new vehicleid; declara vehicleid
vehicleid = GetPlayerVehicleID(playerid); -> Define vehicleid
if(GetVehicleModel(vehicleid) == CarrosIDDKN) -> Pega ID Dos Carros
return SendClientMessage -> Envia Mensagem se o player não estive ao veiculo
Agora Comando da Moto:
if(strcmp("/capacete", cmdtext, true) == 0)
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
new MotosIDDKN = 581
523
462
521
463
522
461
448
468
586
417
425
469
487
512
520
563
593
509
481
510
472
473
493
520
595
484
430
453
432
476
497
513
533
577
452
446
447
454
590
569
537
538
570
449
519
460
488
511
519
548
592 ;//ID DAS MOTOS
if(GetVehicleModel(vehicleid) == CarrosIDDKN) return SendClientMessage(playerid, 0xFFFFFFFF, "Você não esta em uma moto meu gostoso gay");
{
//AQUI CÓDIGO DO CAPACETE
}
return 1;
}
Postado por AdminDraKoN às 5/18/2010 0 comentários Links para esta postagem Marcadores: Códigos, Tutoriais 18
Mai [TUT]Dialog
Topo do GM
#define pawnsamp 1
Em OnPlayerCommandText
if(strcmp(cmdtext,"/PawnSamp", true) == 0)
{
ShowPlayerDialog(playerid,pawnsamp,0,"Site PawnSamp","http://pawnsamp.blogspot.com/\nIsso é bem facil. By GTA","Ok","Cancelar");
return 1;
}
Entenda +: no texto, para pular uma linha a função é \n ou seja, pula para outra linha.
if(strcmp(cmdtext,"/PawnSamp", true) == 0) -> Comandos
ShowPlayerDialog -> Mostra Dialogo
playerid -> Quem irá acontecer no caso o 'playerid'
#define pawnsamp 1 -> Define 'pawnsamp' Numero da Dialog
"Ok" è para confirmar e sair do Dialog, "Cancelar" Para cancelar o Dialog ( mesma coisa que sair e.e)
"Site PawnSamp" É o titulo do dialog.
=~=~=~=~=~=~=~ By GTA =~=~=~=~=~=~=~
Postado por GTA às 5/18/2010 0 comentários Links para esta postagem Marcadores: Códigos, Tutoriais 17
Mai [TUT] Salvando String em Arquivos
TESTE
Salvar Dados Agora Ficou mais facíl
Eis eu aqui fazer um breve tuto simples de como salvar strings em arquivos
Vamos lá:
Primeiramente vamos construir meu comando independente do que queres, Aqui:
Exemplo de Comando
Aqui o Comando sem Salvar
//*************************Admitir************************************
if(strcmp("/sogay", cmd, true) == 0)
{
SendClientMessage(playerid,0xFFFF00AA ,"Parabens Você Admitiu ser gay");
ResetPlayerWeapons(playerid);
new name[MAX_PLAYER_NAME], string[44];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s admitiu ser gay, parabens!.",name);
SendClientMessageToAll(0xFFFF00AA, string);
SetPlayerHealth(playerid,0)
GivePlayerMoney(playerid,-9999999);
return 1;
}
//*************************Admitir************************************
Sendo:
if(strcmp("/sogay", cmd, true) == 0) -> Comando
SendClientMessage -> Envia Mensagem ao player
ResetPlayerWeapons -> Tira Arma do Player
new name[MAX_PLAYER_NAME], string[44] -> Define "NAMES" E "STRINGS" que vamos usar posteriormente
GetPlayerName -> Pega o nome do Player
SetPlayerHealth -> Muda Vida do Player
GivePlayerMoney -> Muda Dinheiro do Player
format -> Formato de como envia a mensagem e salvará no arquivo
SendClientMessageToAll -> Envia Mensagem a Todos
%s -> String que foi "pedida" antes (GetPlayerName)
Então Como Salvar?
Simples Adicione ao Final do GM:
stock Gays(const ahahah[])//DEFINE "GAYS"
{
new File:HF = fopen("gaysdmitidos.txt",io_append);//CRIAR ARQUIVO (io_append)
fwrite(HF,ahahah);
fclose(HF);//FECHA ARQUIVO
}Sendo:
Stock Gays -> Define o código "GAY" (Leia mais Aqui http://wiki.sa-mp.com/wiki/Stocks)
newFile -> Novo Arquivo
gaysdmitidos.txt -> Nome + Extenção do Arquivo
io_append -> Função que Adiciona ao Arquivo
fclose(HF); -> Fecha/Salva Arquivo
Então para Salvar a String Fazemos a seguinte forma...
Adicionamos Isto ao Comando
Isto:
Gays(string); -> IRA USAR A STOCK DEFINIDA ANTERIORMENTE, SALVANDO A STRING AO ARQUIVO
Ficando da Seguinte Forma:
//*************************Admitir************************************
if(strcmp("/sogay", cmd, true) == 0)//COMANDO
{
SendClientMessage(playerid,0xFFFF00AA ,"Parabens Você Admitiu ser gay");//ENViA MSG APENAS AO PLAYER
ResetPlayerWeapons(playerid);//TIRA ARMA
new name[MAX_PLAYER_NAME], string[44];//DEFINE A STRING
GetPlayerName(playerid, name, sizeof(name));//PEGA NOME PARA COLOCAR NA STRING
format(string, sizeof(string), "%s admitiu ser gay, parabens!.",name);//STRING
SendClientMessageToAll(0xFFFF00AA, string);//ENVIA MSG IN GAME
Gays(string);//USA A STOCK PARA SALVAR STRING
SetPlayerHealth(playerid,0);//MATA PLAYER
GivePlayerMoney(playerid,-9999999);//TIRA DINHEIRO DELE
return 1;
}
//*************************Admitir************************************
Caso Queiram Pular linhas no Arquivo:
Abaixo de stock Gays(const ahahah[]):
PAWN Code:
new string[128];Antes da linha fwrite(HF, ahahah), coloque a linha abaixo:
PAWN Code:
format(string, sizeof (string), "%s \r\n", ahahah);Depois substitua a linha fwrite(HF,ahahah); por:
PAWN Code:
fwrite(HF, string);
Assim, com o \r\n dentro do format, cada vez que for registrada mais uma informação no arquivo, ele vai pular uma linha.
Caso utilize apenas o fwrite(HF, ahahah), ele vai escrever sempre um ao lado do outro.
Dica :By: SimS™
Como Ficou:
Créditos a DraKoN não permitido em outro blogs ou sites sem minha permissão
Postado por AdminDraKoN às 5/17/2010 6 comentários Links para esta postagem Marcadores: Códigos, Tutoriais 15
Mai [TUT]Pickup com Teleport
Topo do GameMode
#define Azul 0x009AF6AA //Cor da mensagem
Ainda no Topo do GameMode
new pawnsamp; //Novo pickupEm public OnGameModeInit()
pawnsamp = CreatePickup(-368.5201,1510.6281,76.3117,269.3449); //Aqui é onde o pickup vai ficar, ou seja, onde o player irá passatr para se teleportar.
return 1
} Em public OnPlayerPickUpPickup(playerid, pickupid)
if(pickupid == pawnsamp)
{
SendClientMessage(playerid, Azul, "Você foi para outra area de Drift!"); //Aqui é a mensagem que o servidor vai dar para o player.
SetPlayerPos(playerid,2226.30, 1977.40, 31.42); //Aqui sao as cordenadas que o player sera teleportado.
Postado por GTA às 5/15/2010 0 comentários Links para esta postagem Marcadores: Códigos, Tutoriais 15
Mai [COD] Connect/Disconnect
Quem não conhece aquele mesagens de saiu e entrou no servidor? posta isso e teras!
public OnPlayerDisconnect(playerid, reason)
{
new
string[64],
name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
switch(reason)
{
case 0: format(string,sizeof string,"%s saiu . (Crash)",name);
case 1: format(string,sizeof string,"%s saiu . (/q)",name);
case 2: format(string,sizeof string,"%s saiu . (Kick/Ban)",name);
}
SendClientMessageToAll(COR_GAY,string);
return 1;
}
Postado por GTA às 5/15/2010 0 comentários Links para esta postagem Marcadores: Básicos, Códigos, Tutoriais 15
Mai [COD] Teleportar-se Com Carro
Surgiu de uma Dúvida de um membro no forum então resolvi ajuda-lo
P.S: Testei e Funca Mesmo!
if(strcmp(cmdtext, "/cidadedosgays", true) == 0) //COMANDO
{
if(IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid, COLOR_GAY, "Para Teleportar-se Necessita Ser GAY e Estar Dentro de um CARRO!");
{
new iddocarrogay;//DEFINE A ARRAY DO CARRO
iddocarrogay = GetPlayerVehicleID(playerid);//PEGA ID DO CARRO E TELEPORTA
SetVehiclePos(iddocarrogay, 123.456, 123.456, 12.34);//ID DO CARRO QUE O PLAYER USA TELEPORTARA
return 1;
}
}
Postado por AdminDraKoN às 5/15/2010 0 comentários Links para esta postagem Marcadores: Códigos 14
Mai [COD] Anti DB - Funções Portugues
ANTI DRIVER-BY
public OnPlayerDeath(playerid, killerid, reason)
{
new weap= GetPlayerWeapon(killerid);
if(GetPlayerState(killerid) == 2
GetPlayerState(killerid) == 3)
{
if(weap == 32
weap == 28
weap == 29)
{
GetPlayerName(killerid, Nome, sizeof(Nome));
formato(string, sizeof(string), "-OpenDKNGOSTOSO-: %s foi preso por 2 Min pelo Admin GOSTOSO
Motivo: Driver-By",Nome);
EnviarMensagemaTodos(VERMELHO, string);
SetPlayerInterior(killerid, 0);
SetPlayerPos(killerid,268.5777,1857.9351,9.8133);
SetarTempo("PRESODB",120000,false);
;
}
}
}
Agora:
public PRESODB(killerid)
{
SpawnPlayer(killerid);
}
AQUI ALGUMA FUNÇÕES EM PORTUGUÊS
#include
//*****************PORTUGUES FUNÇOES**********************************
#define ATIVAR true
#define DESATIVA false
#define PegarArmaPlayer GetPlayerWeapon
#define EnviarMensagemaTodos SendClientMessageToAll
#define Banir Ban
#define PegarAcaoDoPlayer GetPlayerSpecialAction
#define PegarNome GetPlayerName
#define formato format
#define Publica public
#define Retornar return
#define AoPlayerConectar OnPlayerConnect
#define AoPlayerDesconectar OnPlayerDisconnect
#define Motivo reason
#define Nome name
#define Estado_Player_Espiando PLAYER_STATE_SPECTATING
#define PegarEstadoPlayer GetPlayerState
#define PlayerAdministrador IsPlayerAdmin
#define novo new
#define AFrente forward
#define AoLigarServerExe OnGameModeInit
#define AoPlayerSpawnar OnPlayerSpawn
#define AoPlayerMorrer OnPlayerDeath
#define AoPlayerDigitar OnPlayerText
#define ComandosaoPlayer OnPlayerCommandText
#define AoPlayerEntrarCarro OnPlayerEnterVehicle
#define AoPlayerSairCarro OnPlayerExitVehicle
#define EstadoPlayerMudar OnPlayerStateChange
#define TeclarAlgo OnPlayerKeyStateChange
#define AtualizarPlayer OnPlayerUpdate
#define AoFecharSampExe OnGameModeExit
#define SetarTempo SetTimer
#define Passageiro ispassenger
#define CarroID vehicleid
#define NovoEstado newstate
#define VelhoEstado oldstate
#define NovasTeclas newkeys
#define VelhasTeclas oldkeys
//*****************PORTUGUES FUNÇOES*************
P.S:
Novo Sistema de Códigos Devido a Reclamação de não seram mostrados por completo
Precisa Retirar Espaços!
Postado por AdminDraKoN às 5/14/2010 0 comentários Links para esta postagem Marcadores: Códigos 13
Mai [COD] Login Automatico RCON
Você que Tem Preguiça de Digita Toda Hora a senha RCON e ja esta Farto Disso Simples Use Este Códigos que loga na RCON por IP..
Claro. Não Use em Computadores Compartilhados ou Internet Compartilhada pois se já sabe né?
PAWN Code:
public OnPlayerConnect(playerid)
{
new plrIP[16];
GetPlayerIp(playerid, plrIP, sizeof(plrIP));
if(!strcmp(plrIP, "127.0.0.1"))//SEU IP
SendRconCommand("login SENHA");//SENHA = SENHA RCON
return 1;
}
Postado por AdminDraKoN às 5/13/2010 0 comentários Links para esta postagem Marcadores: Códigos 09
Mai [COD] Morrer ao Roubar Carro
Morrer ao roubar carro
Eficiente em server's de drift.
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
SendClientMessage(playerid, 0xAA3333AA, "!!! Não roube carros ou morerá !!!");
if(!ispassenger && IsVehicleOccupied(vehicleid)) SetPlayerHealth(playerid, 0.0);//MORRE AO TENTAR ROBAR
return 1;
}
Fim do Mode
stock IsVehicleOccupied(vehicleid)
{
for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == PLAYER_STATE_DRIVER)
return 1;
return 0;
}
By: Ambrósio
Postado por AdminDraKoN às 5/09/2010 0 comentários Links para esta postagem Marcadores: Códigos 09
Mai [COD] Comandinhos
Animações
//---------------------ANIMAÇÕES---------------------------------------------
if(strcmp("/renderse", cmd, true) == 0)
{
SetPlayerSpecialAction(playerid, 10);
return 1;
}
if(strcmp("/ligar", cmd, true) == 0)
{
SetPlayerSpecialAction(playerid, 11);
return 1;
}
if(strcmp("/desligar", cmd, true) == 0)
{
SetPlayerSpecialAction(playerid, 13);
return 1;
}
if(strcmp("/bebado", cmd, true) == 0)
{
ApplyAnimation(playerid, "PED", "WALK_DRUNK", 4.0, 1, 1, 1, 1, 0);
return 1;
}
if(strcmp("/bomba", cmd, true) == 0)
{
ClearAnimations(playerid);
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
return 1;
}
if(strcmp("/apontar", cmd, true) == 0)
{
ApplyAnimation(playerid, "ped", "ARRESTgun", 4.0, 0, 1, 1, 1, -1);
return 1;
}
if(strcmp("/merda", cmd, true) == 0)
{
ApplyAnimation(playerid, "RAPPING", "Laugh_01", 4.0, 0, 0, 0, 0, 0);
return 1;
}
if(strcmp("/mascararse", cmd, true) == 0)
{
ApplyAnimation(playerid, "SHOP", "ROB_Shifty", 4.0, 0, 0, 0, 0, 0);
return 1;
}
if(strcmp("/roubar", cmd, true) == 0)
{
ApplyAnimation(playerid, "SHOP", "ROB_Loop_Threat", 4.0, 1, 0, 0, 0, 0);
return 1;
}
if(strcmp("/cruzarb", cmd, true) == 0)
{
ApplyAnimation(playerid, "COP_AMBIENT", "Coplook_loop", 4.0, 0, 1, 1, 1, -1);
return 1;
}
if(strcmp("/deitar", cmd, true) == 0)
{
ApplyAnimation(playerid, "BEACH", "bather", 4.0, 1, 0, 0, 0, 0);
return 1;
}
if(strcmp("/abaixar", cmd, true) == 0)
{
ApplyAnimation(playerid, "ped", "cower", 3.0, 1, 0, 0, 0, 0);
return 1;
}
if(strcmp("/vomitar", cmd, true) == 0)
{
ApplyAnimation(playerid, "FOOD", "EAT_Vomit_P", 3.0, 0, 0, 0, 0, 0);
return 1;
}
if(strcmp("/comer", cmd, true) == 0)
{
ApplyAnimation(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0);
return 1;
}
if(strcmp("/rap", cmd, true) == 0)
{
ApplyAnimation(playerid, "ON_LOOKERS", "wave_loop", 4.0, 1, 0, 0, 0, 0);
return 1;
}
if(strcmp("/passaramao", cmd, true) == 0)
{
ApplyAnimation(playerid, "SWEET", "sweet_ass_slap", 4.0, 0, 0, 0, 0, 0);
return 1;
}
if(strcmp("/cobrar", cmd, true) == 0)
{
ApplyAnimation(playerid, "DEALER", "DEALER_DEAL", 4.0, 0, 0, 0, 0, 0);
return 1;
}
if(strcmp("/overdose", cmd, true) == 0)
{
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
return 1;
}
if(strcmp("/fumar", cmd, true) == 0)
{
ApplyAnimation(playerid, "SMOKING", "M_smklean_loop", 4.0, 1, 0, 0, 0, 0);
return 1;
}
if(strcmp("/fumar2", cmd, true) == 0)
{
ApplyAnimation(playerid, "SMOKING", "F_smklean_loop", 4.0, 1, 0, 0, 0, 0);
return 1;
}
if(strcmp("/sentar", cmd, true) == 0)
{
ApplyAnimation(playerid, "BEACH", "ParkSit_M_loop", 4.0, 1, 0, 0, 0, 0);
return 1;
}
if(strcmp("/conversar", cmd, true) == 0)
{
ApplyAnimation(playerid, "PED", "IDLE_CHAT", 4.0, 0, 0, 0, 0, 0);
return 1;
}
if(strcmp("/fodase", cmd, true) == 0)
{
ApplyAnimation(playerid, "PED", "fucku", 4.0, 0, 0, 0, 0, 0);
return 1;
}
if(strcmp("/taichi", cmd, true) == 0)
{
ApplyAnimation(playerid, "PARK", "Tai_Chi_Loop", 4.0, 1, 0, 0, 0, 0);
return 1;
}
if(strcmp("/observar", cmd, true) == 0)
{
ApplyAnimation(playerid, "BAR", "dnk_stndF_loop", 4.0, 1, 0, 0, 0, 0);
return 1;
}
//---------------------Lista Animações------------------------------------
if(strcmp("/animes", cmd, true) == 0)
{
SendClientMessage(playerid, ADMINFS_MESSAGE_COLOR, "[DraKoN's Server]:Lista de Animes :");
SendClientMessage(playerid, ADMINFS_MESSAGE_COLOR, "/renderse /ligar /desligar /bebado /bomba /apontar /merda /mascararse");
SendClientMessage(playerid, ADMINFS_MESSAGE_COLOR, "/roubar /cruzarb /deitar /abaixar /vomitar /comer /rap /passaramao");
SendClientMessage(playerid, ADMINFS_MESSAGE_COLOR, "/cobrar /overdose /fumar /fumar2 /sentar /conversar /fodase /taichi");
SendClientMessage(playerid, ADMINFS_MESSAGE_COLOR, "/observar ");
return 1;
}
Suicidio
if(strcmp("/kill", cmd, true) == 0)Reparar Carro
{
SetPlayerHealth(playerid, 0);
SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"Voce Se Matou!");
return 1;
}
if(strcmp("/reparar", cmd, true) == 0)Nick Off
{
SetVehicleHealth(playerid,100);
SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"Carro Reparado");
return 1;
}
if (strcmp("/nickoff", cmd, true) == 0)
{
for(new i = 0; i < class="pawnkeyword" style=" ">return 1;
}
Nick ON
:
if (strcmp("/nickon", cmd, true) == 0)
{
for(new i = 0; i < class="pawnkeyword" style=" ">return 1;
}
Comando Procurar Bots
:
if(strcmp(cmd, "/bots", true) == 0)Defines Algumas Cores
{
SendClientMessage(playerid,AMARELO,"[DrK] Procurando Bots...");
for(new i=0; i < class="pawnkeyword" style=" ">if(IsPlayerConnected(i))
{
new ip[16];
GetPlayerIp(playerid, ip, sizeof(ip));
if(strcmp(ip, "255.255.255.255") == 0)
{
format(string,256,"[DrK] Bot Detectado! IP: %d",ip);
SendClientMessageToAll(LARANJA,string);
Kick(playerid);
return 0;
}
}
}
return 1;
}
//*********************Cores****************************************************Level de Procurado + Score ao Matar
#define LARANJA 0xFF8C00AA
#define VERDE 0x33AA33AA
#define AMARELO 0xFFFF00AA
#define COLOR 0xFF0000AA
#define AZUL 0x33CCFFAA
#define AAZUL 0x2641FEAA
//******************************************************************************
public OnPlayerDeath(playerid, killerid, reason)Admin ONLINE
{
SetPlayerWantedLevel(killerid, 1);
SetPlayerWantedLevel(playerid, 0);
SetPlayerScore(killerid, GetPlayerScore(playerid) + 1);
SetPlayerScore(playerid, GetPlayerScore(playerid) - 1);
SendClientMessage(playerid,LARANJA,"Você morreu, perdeu 1 de Score, Digite /top.");
SendClientMessage(killerid, AZUL, "Você matou e ganho 1 de Score, Digite /top.");
}
//-----------------------------Admins Online--------------------------
if(strcmp(cmdtext, "/admins", true) == 0){//Favela: ir a favela
new Jogador[24];
new count = 0;
new msg[120];
new ListaAdmins[128];
for(new i=0; iif(IsPlayerConnected(i) && IsPlayerAdmin(i)){
GetPlayerName(i,Jogador,24);
format(msg,sizeof(msg),"Admins Online's: %s", Jogador);
SendClientMessage(playerid, 0x000FFFAA, msg);
count++;
}
}
if(count >= 0){
SendClientMessage(playerid, ADMINFS_MESSAGE_COLOR, "Admins Off");
dini_IntSet (ListaAdmins, "Admins", 1);
SendClientMessage(playerid, ADMINFS_MESSAGE_COLOR, ListaAdmins);
}
return 1;
}
if(strcmp("/favelatraficante", cmd, true) == 0)
{
SendClientMessage(playerid,PM_OUTGOING_COLOR ,"/favelatraficante: para entrar ao trafico");
SendClientMessage(playerid,PM_OUTGOING_COLOR ,"/favelapolicial: para entra na policia");
return 1;
}
if(strcmp("/favelatraficante", cmd, true) == 0)
{
SendClientMessage(playerid,PM_OUTGOING_COLOR ,"Bem Vindo a Favela");
SetPlayerPos(playerid,2237.6868,-1079.4060,41.6102);
SetPlayerSkin(playerid, 268);
ResetPlayerWeapons(0);
GivePlayerWeapon(playerid, 26, 9999);
GivePlayerWeapon(playerid, 24, 9999);
GivePlayerWeapon(playerid, 31, 9999);
GivePlayerWeapon(playerid, 32, 9999);
return 1;
}
//-------------------------------------------------------------------------
if(strcmp("/favelapolicial", cmd, true) == 0)
{
SendClientMessage(playerid,PM_OUTGOING_COLOR ,"Bem Vindo a Favela");
SetPlayerPos(playerid,2237.6868,-1079.4060,41.6102);
SetPlayerSkin(playerid, 281);
ResetPlayerWeapons(0);
GivePlayerWeapon(playerid, 26, 9999);
GivePlayerWeapon(playerid, 24, 9999);
GivePlayerWeapon(playerid, 31, 9999);
GivePlayerWeapon(playerid, 32, 9999);
return 1;
}
if (strcmp("/comando", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, 0xFF6347AA, "Eu Também Sei Criar Comandos Idiotas");
GivePlayerMoney(playerid, 1);
return 1;
}
0 comentários:
Postar um comentário