Mostrando postagens com marcador Códigos. Mostrar todas as postagens
teste do eddy

[COD]Move Object

//Topo

new objetopawn;

//OnGameInit
objetopawn = CreateObject(ID,CORDENADAS); //De onde ele fica

ID: Id do Objeto, ou seja se for um Portao vai ser 980, e as cordenadas, mas se bem que quando você converte os objetos ja vem tudo certo, só colar ali no meio dos ( ) ..

//Command Text

if(!strcmp("/voltarparalugar", cmdtext, true, 10))
{
MoveObject(
objetopawn, CODENADAS, 2.0); //Cordenada pra onde ele fica.. 2.0 é a velocidade
}
return 1;
}

if(!strcmp("/mexerparaoutrolugar", cmdtext, true, 10))
{
MoveObject(
objetopawn, CODENADAS, 2.0); //Cordenada pra onde ele vai.. 2.0 é a velocidade
}
return 1;
}
Bom, um tutorial simples, aos poucos vou melhorar ele, pois estou sem ideias de fazer um exemplo, mas vou fazer um exemplo de um portao abrindo e fechando jaja.

[FS/COD]Anti-Bot



Galera, este codigo/fs ja esta pronto, só você colocar que ja tem todos os " nomes " de bot's que podem invadir o seu servidor..



[COD/TUT]Chat Admin/Vip



Opa galera, vou postar agora um codigo para você fazer um Chat Admin, um código bem simples.
Ai você muda pra variavel de Admin que você usa.
No caso esta assim, por que é a forma que eu uso.
Entao você pode mudar para a sua variável.
Somente os admins poderão ver este Chat!


[TUT/FS]Carros ( Completo )

Criando Carros ( Completo )

Topo do GM/FS

new CarrosPs[MAX_PLAYERS];

public OnPlayerCommandText

if (strcmp(cmdtext, "/carros", true) == 0)
{
ShowPlayerDialog(playerid,158,DIALOG_STYLE_LIST,"Pegar carros","\nElegy\nNRG-500","Ok","Sair");
return 1;
}

public OnDialogResponse

if(dialogid == 158)
{
if(response)
{
if(listitem == 0)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle(562,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
}
if(listitem == 1)
{
if(CarrosPs[playerid] != INVALID_VEHICLE_ID)
DestroyVehicle(CarrosPs[playerid]);
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
CarrosPs[playerid] = CreateVehicle(522,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, CarrosPs[playerid], 0);
}
}


public OnPlayerExitVehicle

SetTimerEx("psDestroyVehicle", 20000, 0, "i", vehicleid);

Final do GM/FS

forward psDestroyVehicle(vehicleid);
public psDestroyVehicle(vehicleid)
{
return DestroyVehicle(vehicleid);
}

Assim, quando o player criar um carro, e tentar criar outro, o outro carro ira sumir, e iria ficar com o novo carro..

Se o player sair do carro, e ficar 20 segundos fora, o carro vai desaparecer.. Isto é bom para que se o player sair do Servidor, ai o carro ira sumir.

PS : PawnSamp

Ai você pode mudar a id dos veiculos, adicionar/remover veiculos e enfim..


By: GTA

[TUT] Algumas Funções de String

Introdução
Bem neste Tutorial Ensinarei como usar 'Strfind' usada para pesquisar uma String em outras String Veja um Exemplo:

if(strfind("Nossa String", "Nossa", true) != -1)
{
SendClientMessageToAll(0xFFFFFFFF, "Eu Encontrei a Palavra Nossa...");
}
EXPLICAÇÃO:

if( = Nesta Condicional colocaremos a 'strfind' no qual executará a função de buscar o texto
strfind("Nossa String", "Nossa", true) = Agora ele procura a Palavra 'Nossa' na Frase 'Nossa String' e retorna true) != -1) = Indicando 'Verdadeiro' (true) isto é, se encontrou a Palavra

O Mesmo podemos usar em diversas funções tais como GetPlayerName

public OnPlayerConnect(playerid)
{
new name[MAX_PLAYER_NAME], string[44];
0, 0);">(playerid, name, sizeof(name));
if(strfind(name, "gay", true) != -1)
{
format(string, sizeof(string), " Oi%s no seu Nick tem a palavra gay kkkkkkkkk .",name);
SendClientMessageToAll(0xFFFF00AA, string);
}
return 1;
}
Ou Até mesmo procurar palavrões (palavras de baixo calão) em texto..

[TUT] strcmp
Introdução
Bem neste Tutorial Ensinarei como usar 'strcmp' usada para comparar uma String em outra String,bastante usada para comandos..
Veja um Exemplo:
if(!strcmp("Dracu", "DraKoN", true, 6)
{
SendClientMessageToAll(0xFFFFFFFF, "Você não é o DraKoN");
}
EXPLICAÇÃO:

if( = Nesta Condicional colocaremos a 'strcmp' no qual executará a função de comparar os 2 (dois) textos
strcmp("Dracu", "DraKoN" = Agora ele comparar a Palavra 'DraCu' com a 'DraKoN' e retorna diferente de true Indicando 'Falso' (Falso) isto é, se é diferente de DraKoN
3 = Esse 3 (Três) é usado para colocar o tamanho da segunda String (DraKoN)
também como algumas pessoas conhecem por Strlen que veremos Logo Abaixo

O Mesmo podemos usar em diversas funções tais como cmdtext

public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/me", true, 3))
{
if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USE: /me [acao]");
new str[128];
GetPlayerName(playerid, str, sizeof(str));
format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
SendClientMessageToAll(0xFFFF00AA, str);
return 1;
}
return 0;
}
Ou Até mesmo comparar diversas coisas..

[TUT] Strdel

Introdução:
Nesta parte de vosso tutorial vamos aprender como usar Strdel usado para deletar partes de uma String..

Vejamos que nossa String Seja:

new string[20] = "Esta é Nossa String";
20 É O Tamanho de nossa String que seria o Vosso Texto

strdel(string, 0,7);
EXPLICANDO:

strdel(string = Esta Parte Indica que Deletaremos a 'String' que definimos anteriormente
0, 7) = Esta parte indica onde iremos começar a deletar e onde terminaremos de deletar, observe que ficou da Seguinte Maneira (0-7)

Esta é Nossa String
Istó é, a parte vermelha (0-7) deletamos ficando 'Nossa String'

Aqui Usando um Conjutno de strfind + strdel

new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof name);
new
startpos = strfind(name, "[", true),
endpos = strfind(name, "]", true);
if(startpos != -1 && endpos != -1)
{
strdel(name, startpos, endpos + 1);
if(name[0])
{
SetPlayerName(playerid, name);
new string[128];
format(string, sizeof(string), "| Seu Nick Foi mudado para '%s', devido o conflito de clans ou suspeita de Fake Tag", name);
SendClientMessage(playerid,0x7777FF,string);
}
}

[TUT] Strlen
Introdução:
Pois bem chegando a nossa Última função vou explicar um pouco melhor sobre isto, vejam strlen é usada para Retornar um Tamanho de uma String
Digamos:
'Eu Sou o DraKoN'
Contando o número dessa frase obtivemos 16 Caracteres ( ou to mal de conta -q)
Para usar com strlen podemos usar da seguinte forma:
Em OnPlayerText

if(strlen(text) > 100) return SendClientMessage(playerid, COLOR_GREY, "Seu Texto tem mais que 100 Caracters")
EXPLICANDO:
if Condicional 'SE'
strlen(text) Lê o tamanho do Texto
> 100 Se for maior que 100 Envia Mensagem Indicando

Otimizar o Código sem precisar usar funções de Strings

// Essa forma de função é mais otimizada por não chamar nenhum função,além de poder ser usada como STRFIND,STRCMP, e ainda STRLEN em certas formas

/* EXAMPLE */

if(text[0] == ' ')// Seu Texto não tem Caracteres (strlen)
if(text[0] == 'A')//Seu texto tem "A"
Bom chegamos ao fim de mais um Tutorial,aqui algumas funções de string também usadas

Strcmp: Compare two strings to check if they are the same. Strfind: Search for a string in a string. Strtok: Get the next word/parameter in a string. Strdel: Delete part of a string. Strins: Insert text into a string. Strmid: Extract part of a string into another string. Strpack: Pack a string into a destination. Strval: Convert a string into an integer. Strcat: Concatenate two strings into a destination reference.
Tutorial Criador por DraKoN, Agradecimento a Dark Team PT & Flávio Toribio

[FS] GM-ADDON Anti MH


É um GM-ADDON,Enfim não sabia o que colocar,

Bom a tempos vinha pensando em uma forma de parar com o Anti-Money-Hack sem que fosse preciso Dinheiro alternativo,para mim não havia solução alguma,muitas vezes eu pensava como era feito o sistema de click de anti mh,mais nunca vinha a cabeça alguma idéia,então após muito pensar descobri uma forma:
Nececita:
• Conhecimento Mínimo em Pawn
• Desabilitar os Stunts
• Ultima Includes do SA:MP (Atualizadas R

Enquantos as Ammu-Nations e Maquininhas de Refri?
Bom,como padrão de todo Money Hack,ele aumenta dinheiro,isto é na Ammu-Nation Diminui portanto Ammu-Nations não precisaram ser desabitadas..o mesmo com as Maquininhas

Como Usar?

Bom, Primeiramente faça o seguinte em seu Pawno ou aplicativo que usa para 'codar'
CTRL + H
Coloque na parte de cima 'GivePlayerMoney' por 'GivePlayerCash', agora coloque o seguinte código ao final do GM:

pawn Code:
stock GivePlayerCash(playerid,Contia) { GivePlayerMoney(playerid,Contia); SetPVarInt(playerid,"grana",GetPlayerMoney(playerid)); SetPVarInt(playerid,"AntiMH",10); } forward CheckGrana(); public CheckGrana() { for(new to_dos = 0;to_dos < MAX_PLAYERS;to_dos++)//todos players { if(GetPVarInt(to_dos,"AntiMH") == 10) { SetPVarInt(to_dos ,"AntiMH",0); return 0; } if(GetPlayerMoney(to_dos) < GetPVarInt(to_dos,"grana")) SetPVarInt(to_dos,"grana",GetPlayerMoney(to_dos));//Enqaunto Grana for menor que money , grana = money while(GetPlayerMoney(to_dos) <= GetPVarInt(to_dos,"grana")) return 0;//Enquanto Money for Menor que Grana e o Anti MH desablitado /return 0; /* COLOQUE AQUI SE ELE USAR MONEY HACK */ } return 1; }

E Esse aqui no 'OnGameModeInit'


pawn Code:
SetTimer("CheckGrana",2000,true);

Obs: Não altere o Tempo para não dar conflito..


Créditos a DraKoN

Código bem Simples,mais muito melhor, se tiver Bugs PM-ME
Enjoy Kids...


Desculpa a Falta de Atualização do BLog...

[TUT]Prender carro em Tele

Segue o comando:

if(strcmp(cmd, "/PQP", true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) != ID DO VEICULO) return SendClientMessage(playerid, COR, "Mensagem Ex: È proibido este veiculo Aqui!");
{
SetVehiclePos(GetPlayerVehicleID(playerid), CORDENADAS PARA CARRO);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 266.6323);
LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
}
}
else
{
SetPlayerPos(playerid, CORDENADAS PARA PLAYER);
TogglePlayerControllable(playerid, 1);
SetPlayerInterior(playerid, 0);
ResetPlayerWeapons(playerid);
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new string[256];
format(string, sizeof(string), "%s foi para a puta que pariu (/pqp)", sendername);
SendClientMessageToAll(COR, string);
return 1;
}
!= : Diferente, ou seja, só pode o veiculo que voce colocar, nao pode outro veiculo.

Se Caso você mudar o != para == , irá bloquear para ele, ou seja, ira liberar para todos os veiculos, menos para o ID que você colocou.


By GTA

[COD] Rank Sort


Para quem não esta conseguindo ver o código acessem:
Lá tem ele esta melhor para visualização


Ele simplesmente cria um Array ao morrer o player perde 1 ao matar ganha 1 então quando digita /top ele faz um classificação e mostra os melhor ranking


[COD] Tempo Alternativo para Races

Bom criei esse tempo alternativo numa corrida, já vou a escola,rs.

Topo GM:
new TempForPlayer[MAX_PLAYERS];
new Tempo;
#define InitTemp(%1) TempoParaPlayer(%1)
#define EndTemp(%1) ParaTemp(%1)

Final GM:
forward TempoParaPlayer(playerid);
public TempoParaPlayer(playerid)
{
Tempo = SetTimerEx("TempoParaPlayer", 1000, false, "d", playerid);
TempForPlayer[playerid] = TempForPlayer[playerid] +1;
return 1;
}

stock ParaTemp(aquem,Tempo)
{
KillTimer(Tempo);
TempForPlayer[playerid] = 0;
}
Agora quando Iniciar a Corrida Ex:
InitTemp(playerid)

E para Finalizar
new tempodacorrida[128];
format(
tempodacorrida
, sizeof(
tempodacorrida
), "Terminaste a Corrida em %d .",TempForPlayer[playerid]);
SendClientMessage(playerid,0xFFFF00AA, tempodacorrida);
EndTemp(playerid);

[COD] /salvar /irsalvo

Esse comando serve para salvar uma posição e depois ir até ela de novo.

if (strcmp(cmdtext, "/salvar", true)==0)
{
GetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
GetPlayerFacingAngle(playerid, PosA[playerid]);
SendClientMessage(playerid, COR, "Você guardou a posição use '/irsalvo'!");
PosI[playerid] = (GetPlayerInterior(playerid));
PlayerPlaySound(playerid, 1137 , 0.0, 0.0, 0.0);
return 1;
}

if (strcmp(cmdtext, "/irsalvo", true)==0)
{
if (!floatsqroot(PosX[playerid]+PosY[playerid]+PosZ[playerid]))
{
return SendClientMessage(playerid, COR, "Deve salvar antes!'/salvar'");
}
else
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid), PosX[playerid], PosY[playerid], PosZ[playerid]);
SetVehicleZAngle(GetPlayerVehicleID(playerid), PosA[playerid]);
SetCameraBehindPlayer(playerid);
LinkVehicleToInterior(GetPlayerVehicleID(playerid), PosI[playerid]);
}
else
{
EnCoche[playerid] = false;
SetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
SetPlayerFacingAngle(playerid, PosA[playerid]);
SetCameraBehindPlayer(playerid);
}
PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
SetPlayerInterior(playerid, PosI[playerid]);
SendClientMessage(playerid, COR, "Posição carregada com sucesso!!");
}
return 1;
}

[COD]Alguns teles.

Para alguem que tem duvida, ai vai 3 teleportes para interior.

if(strcmp(cmd, "/bar", true) == 0)
{
SetPlayerPos(playerid, 495.7801,-76.0305,998.7578);
SetPlayerInterior(playerid, 11);
ResetPlayerWeapons(playerid);
GetPlayerName(playerid, sendername, sizeof(sendername));
new string[256];
format(string, sizeof(string), "%s Foi se divertir no Bar! (/bar)", sendername);
SendClientMessageToAll(COR, string);
return 1;
}
if(strcmp(cmd, "/balada", true) == 0)
{
SetPlayerPos(playerid, 476.47265625, -24.935546875, 1003.4013061523);
SetPlayerInterior(playerid, 17);
ResetPlayerWeapons(playerid);
GetPlayerName(playerid, sendername, sizeof(sendername));
new string[256];
format(string, sizeof(string), "%s Foi se divertir na Balada! (/balada)", sendername);
SendClientMessageToAll(COR, string);
return 1;
}
if(strcmp(cmd, "/cassino", true) == 0)
{
SetPlayerPos(playerid, 2233.8032, 1712.2303, 1011.7632);
SetPlayerInterior(playerid, 1);
ResetPlayerWeapons(playerid);
GetPlayerName(playerid, sendername, sizeof(sendername));
new string[256];
format(string, sizeof(string), "%s Foi se divertir e apostar no cassino! (/cassino)", sendername);
SendClientMessageToAll(COR, string);
return 1;
}

[COD]Dia/Noite

Este codigo só muda o tempo pra pessoa que digitar.. Nao muda pro servidor todo..

if (strcmp("/dia", cmd, true) == 0)
{
SendClientMessage(playerid, COR, "Você mudou o tempo para Dia!");
SetPlayerTime(playerid, 12,0);
return 1;
}
if (strcmp("/noite", cmd, true) == 0)
{
SendClientMessage(playerid, COR, "Você mudou o tempo para Noite!");
SetPlayerTime(playerid, 00,0);
return 1;
}

[COD] Chat Kill - F9

Adicionando um Chat Kill Com Quem Entrou (icone Azul) quem Saiu (Icone Vermelho), e quem morre (Matador ARMA Morredor) -q


OnPlayerConnect

public OnPlayerConnect(playerid)
{
SendDeathMessage(playerid, INVALID_PLAYER_ID, 200);
return 1;
}


OnPlayerDisconnect

public OnPlayerDisconnect(playerid)
{
SendDeathMessage(INVALID_PLAYER_ID, playerid, 201);
return 1;
}



OnPlayerDeath

SendDeathMessage(killerid,playerid,reason);

[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;
}

[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);
}
}

[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

[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

[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

[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



[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;
}