[AJUDA] Cуdigo Do Comando /eu /do
#1

Estou Criando Um servidor e estou precisando desses comandos quem poder Passar ^^
Reply
#2

Estude e adapte:

pawn Код:
CMD:eu(playerid,params[])
{
    new texto, Float:PPos[3], nome[24];
    if(sscanf(params, "s[100]", texto)) return SendClientMessage(playerid, -1, "USO: /eu {00E5FF}[Motivo]");
    GetPlayerPos(playerid, PPos[0], PPos[1], PPos[2]);
    GetPlayerName(playerid, nome, 24);
    foreach(Player, i)
    {
        if(IsPlayerInRangeOfPoint(i, /*Distancia da mensagem*/, PPos[0], PPos[1], PPos[2])
        {
            new string[124];
            format(string, 124, "%s %s", nome, texto);
            SendClientMessage(i, -1, string);
        }
    }
    return 1;
}
Reply
#3

Los, mas nisso:
pawn Код:
if(IsPlayerInRangeOfPoint(i, /*Distancia da mensagem*/, PPos[0], PPos[1], PPos[2])
A funзгo IsPlayerInRangeOfPoint nгo possuн string como parвmetro, ou possui?
Reply
#4

Isto deve resolver o seu problema .


Montei os comandos pra vocк .


pawn Код:
//Coloque no OnPlayerCommandText:


if(strfind(cmdtext, "/eu", true) == 0)
    {
        if(cmdtext[3] == 0 || cmdtext[3] == 32)
        {
            if(cmdtext[3] != 32 || (cmdtext[4] == 0 && cmdtext[3] == 32)) return SendClientMessage(playerid, 0xFFFFFFAA, "Comando: /eu [texto]");
            new NickName[MAX_PLAYER_NAME];
            new Float:P_Pos[3];
            GetPlayerName(playerid, NickName, MAX_PLAYER_NAME);
            GetPlayerPos(playerid, P_Pos[0], P_Pos[1], P_Pos[2]);
            format(cmdtext, 128, "%s %s.", NickName, cmdtext[4]);
            for(new x = 0, y = GetMaxPlayers(); x != y; x++)
            {
                if(IsPlayerInRangeOfPoint(x, 7.0, P_Pos[0], P_Pos[1], P_Pos[2]))
                {
                    SendClientMessage(x, 0x33CCFFAA, cmdtext);
                }
            }
            return true;
        }
    }
    if(strfind(cmdtext, "/do", true) == 0)
    {
        if(cmdtext[3] == 0 || cmdtext[3] == 32)
        {
            if(cmdtext[3] != 32 || (cmdtext[4] == 0 && cmdtext[3] == 32)) return SendClientMessage(playerid, 0xFFFFFFAA, "Comando: /do [aзгo]");
            new NickName[MAX_PLAYER_NAME];
            new Float:P_Pos[3];
            GetPlayerName(playerid, NickName, MAX_PLAYER_NAME);
            GetPlayerPos(playerid, P_Pos[0], P_Pos[1], P_Pos[2]);
            format(cmdtext, 128, "%s estб fazendo %s.", NickName, cmdtext[4]);
            for(new x = 0, y = GetMaxPlayers(); x != y; x++)
            {
                if(IsPlayerInRangeOfPoint(x, 7.0, P_Pos[0], P_Pos[1], P_Pos[2]))
                {
                    SendClientMessage(x, 0x33CCFFAA, cmdtext);
                }
            }
            return true;
        }
    }


Espero ter ajudado .
Reply
#5

Quote:
Originally Posted by Adrian Fahrenheit Tepes
Посмотреть сообщение
Los, mas nisso:
pawn Код:
if(IsPlayerInRangeOfPoint(i, /*Distancia da mensagem*/, PPos[0], PPos[1], PPos[2])
A funзгo IsPlayerInRangeOfPoint nгo possuн string como parвmetro, ou possui?
Nгo. A funзгo nгo contйm const. Somente floats.

Distвncia que eu digo й o raio ou seja.

pawn Код:
if(IsPlayerInRangeOfPoint(i, 5.0, PPos[0], PPos[1], PPos[2])
Sу vai aparecer a mensagem para players que estejam na distвncia de 5.0 do player que digitou /eu.
Reply
#6

AH, e se chama const? Nгo sabia. Entгo tб valeu.
Reply
#7

Quote:
Originally Posted by Adrian Fahrenheit Tepes
Посмотреть сообщение
AH, e se chama const? Nгo sabia. Entгo tб valeu.
https://sampwiki.blast.hk/wiki/Keywords:Initialisers#const
Reply
#8

Код:
C:\Documents and Settings\Usuario\Desktop\Iniciante\gamemodes\DM.pwn(378) : warning 203: symbol is never used: "eu"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Los Nгo consegui identificar esse Warning
Reply
#9

CTRL + F, e coloca new eu;, quando achar deleta
Reply
#10

Quote:
Originally Posted by Pedro Pawno
Посмотреть сообщение
Код:
C:\Documents and Settings\Usuario\Desktop\Iniciante\gamemodes\DM.pwn(378) : warning 203: symbol is never used: "eu"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Los Nгo consegui identificar esse Warning
Quote:
Originally Posted by WeenSoares_
Посмотреть сообщение
CTRL + F, e coloca new eu;, quando achar deleta
Nгo й nada disso.

Pedro, para vocк usar o comando que te passei й necessбrio da [Include] ZCMD e do [Plugin] sscanf.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)