Olá! Irei mostrar alguns codes comuns que talvez todo server deve ter
1- Comando /kickar
2- Comando /reportar Muito utilizados em servers de dm
3- Comando que pode escolher estilo de dança.
4- Comando /trazer
5- Comando /ir, nessa utilizarei uma array
1- Comando /kickar
- Código:
CMD:kick(playerid, params[])
{
new NomeCara[MAX_PLAYER_NAME], NomePlayerr[MAX_PLAYER_NAME], string[90], idplayer, motivo[100];
if(sscanf(params,"ds[100]",idplayer ,motivo)) return SendClientMessage(playerid, -1, "Use corretamente: /kick [id] [Motivo]");
if(!IsPlayerConnected(idplayer)) return SendClientMessage(playerid, -1, "ERROR: Este id não está conectado");
GetPlayerName(playerid, NomePlayerr, sizeof(NomePlayerr));
GetPlayerName(idplayer, NomeCara, sizeof(NomeCara));
format(string, sizeof(string), "{0000FF}[SERVER] {DF0000}%s foi kickado pelo admin %s! Motivo: %s",NomeCara, NomePlayerr, motivo);
SendClientMessageToAll(playerid, string);
Kick(idplayer);
return 1;
}
2- Comando /reportar Muito utilizados em servers de dm
- Código:
CMD:reportar(playerid, params[])
{
new idplayer, motivo[90], nomereportador[MAX_PLAYER_NAME], nomeacusado[MAX_PLAYER_NAME], string[120], string2[120];
if(sscanf(params,"ds[90]", idplayer, motivo)) return SendClientMessage(playerid, -1, "Use corretamente: /reportar [ ID DO PLAYER ] [ MOTIVO ]");
if(!IsPlayerConnected(idplayer)) return SendClientMessage(playerid, -1, "ERROR: Este id não está conectado");
GetPlayerName(playerid, nomereportador, sizeof(nomereportador));
GetPlayerName(idplayer, nomeacusado, sizeof(nomeacusado));
format(string, sizeof(string), "Você reportou %s aguarde admins verem", NomeAcusado);
format(string2, sizeof(string2), "Reports: %s acusou %s, Motivo: %s", nomereportador, nomeacusado, motivo);
SendClientMessage(playerid,-1, string);
SendClientMessageToAll(-1, string2); // Aqui você bota a variavel de mensagens admins tal
return 1;
}
3- Comando que pode escolher estilo de dança.
- Código:
CMD:dancar(playerid, params[])
{
new id;
if(sscanf(params, "d", id)) return SendClientMessage(playerid, -1, "Use corretamente: /dancar [ 1 - 5]");
if(id < 1 || id > 5)
return SendClientMessage(playerid, -1, "ERROR: Estilos são válidos apenas [1 - 5]");
if(id == 1)
SetPlayerSpecialAction(playerid,5);
if(id == 2)
SetPlayerSpecialAction(playerid,6);
if(id == 3)
SetPlayerSpecialAction(playerid,7);
if(id == 4)
SetPlayerSpecialAction(playerid,8);
if(id == 5)
SetPlayerSpecialAction(playerid,9);
return true;
}
4- Comando /trazer
- Código:
CMD:trazer(playerid, params[])
{
new idplayer, string2[100], string1[100],nomecara[MAX_PLAYER_NAME], nomegay[MAX_PLAYER_NAME], Float: x, Float: y , Float: z;
if(sscanf(params,"d", idplayer)) return SendClientMessage(playerid, -1, "Use corretamente: /trazer [ ID ]");
if(!IsPlayerConnected(idplayer)) return SendClientMessage(playerid, -1, "ERROR: Este id não está conectado");
GetPlayerName(playerid, nomecara, sizeof(nomecara));
GetPlayerName(idplayer, nomegay, sizeof(nomegay));
format(string1, sizeof(string1), "Você foi ate %s", nomegay);
format(string2, sizeof(string2), "%s veio ate voce", nomecara);
SendClientMessage(playerid,-1, string1);
SendClientMessage(idplayer,-1 , string2);
GetPlayerPos(idplayer, x, y , z);
SetPlayerPos(playerid, x, y , z);
return true;
}
5- Comando /ir, nessa utilizarei uma array
- Código:
CMD:ir(playerid,params[])
{
new nome[MAX_PLAYER_NAME], nomecara[MAX_PLAYER_NAME];
new string[70],string2[70] , id, Float:Pos[3];
GetPlayerName(playerid,nome,sizeof(nome));
GetPlayerName(playerid,nomecara,sizeof(nomecara));
if(sscanf(params,"d",id)) return SendClientMessage(playerid,-1,"Use corretamente: /ir [id]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"ERROR: Este jogador não está conectado");
format(string, sizeof(string) ,"%s veio ate você",nome);
format(string2, sizeof(string2), "Você foi ate %s", nomecara);
GetPlayerPos(id, Pos[0], Pos[1] , Pos[2] );
SendClientMessage(id , -1 , string);
SendClientMessage(playerid, -1, string2);
SetPlayerPos(playerid, Pos[0] , Pos[1] , Pos[2] );
return 1;
}