[Pedido] Comando -
Tymer - 19.07.2011
RESOLVIDO
Re: [Pedido] Comando -
akZ - 19.07.2011
pawn Код:
if(strcmp(cmd, "/gritar", true) == 0 || strcmp(cmd, "/g", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo fez o Loggin !");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, COLOR_RED, "|-Vocк foi mutado por um admin, nгo pode falar-|");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USO: (/g)ritar [local chat]");
return 1;
}
format(string, sizeof(string), "%s Berra: %s!!", sendername, result);
FicarRoco[playerid]++;
ProxDetector(30.0, playerid, string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_FADE1,COLOR_FADE2);
printf("[chat] [grito] [%s] %s", sendername, result);
}
return 1;
}
Espero ter ajudado .
Re: [Pedido] Comando -
Tymer - 19.07.2011
RESOLVIDO
Re: [Pedido] Comando -
Shadoww5 - 19.07.2011
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256], idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/gritar", true) == 0)
{
new n[24], str[128];
GetPlayerName(playerid, n, 24);
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result)) return SendClientMessage(playerid, 0xFFFFFFFF, "USO: /gritar [texto]");
format(str, sizeof(str), "%s grita: %s !", n, result);
ProxDetector(35.0, playerid, str,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF);
return 1;
}
return 0;
}
Re: [Pedido] Comando -
Macintosh - 19.07.2011
PHP код:
new gPlayerLogged[MAX_PLAYERS]; // Topo do GM.
Re: [Pedido] Comando -
Tymer - 19.07.2011
RESOLVIDO
Re: [Pedido] Comando -
Shadoww5 - 19.07.2011
Quote:
Originally Posted by Shickcard
PHP код:
new gPlayerLogged[MAX_PLAYERS]; // Topo do GM.
|
Alйm dessa nova array deveria colocar isto aqui tambйm:
PHP код:
enum a
{
pMuted
}
new PlayerInfo[MAX_PLAYERS][a];
new FicarRoco[MAX_PLAYERS];
Entгo o melhor a ser usado seria o codigo que eu postei.
#EDIT
Tymer, poe isto no final do seu GM:
PHP код:
public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
if(IsPlayerConnected(playerid))
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
{
SendClientMessage(i, col1, string);
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
SendClientMessage(i, col2, string);
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
SendClientMessage(i, col3, string);
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
SendClientMessage(i, col4, string);
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
SendClientMessage(i, col5, string);
}
}
}
}//not connected
return 1;
}
Re: [Pedido] Comando -
Tymer - 19.07.2011
RESOLVIDO
Re: [Pedido] Comando -
Bruno Pereira - 19.07.2011
Usa o do Shadow.
Re: [Pedido] Comando -
Tymer - 19.07.2011
RESOLVIDO