SA-MP Forums Archive
[Pedido] Sistema de PM - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Pedido] Sistema de PM (/showthread.php?tid=332402)



[Pedido] Sistema de PM - Lucas_HenryK - 08.04.2012

eu tinha eu que baixei era simples do jetio que quero sу o comando /pm
quando o player envia aparece uma game text PM ENVIADA quando recebe PM RECEBIDA
sу isso se alguem pode ajudar agradeзo


Re: [Pedido] Sistema de PM - .FuneraL. - 08.04.2012

Vocк quer que apareзa a GameText , й isso ?


Re: [Pedido] Sistema de PM - Lucas_HenryK - 08.04.2012

ah sei la do jeito que der para me ajudar ta otimo ser quero /pm mesmo em strcmp


Re: [Pedido] Sistema de PM - Lucas_HenryK - 08.04.2012

alguem ??


Re: [Pedido] Sistema de PM - BreakDriFT - 08.04.2012

aaffff , o base Fs que vme com osamp tem sistema de pm so traduzir e editar ao seu gosto .........
Cada coisa viu


Re: [Pedido] Sistema de PM - Lucas_HenryK - 08.04.2012

entendi nada.


Re: [Pedido] Sistema de PM - Gustavo_z - 08.04.2012

Tente ver essas 2, acho que sгo melhores, um simples, e um em Dialog.

Simples: https://sampforum.blast.hk/showthread.php?tid=308633
Dialog: https://sampforum.blast.hk/showthread.php?tid=143122


Re: [Pedido] Sistema de PM - Lucas_HenryK - 08.04.2012

queria um mais simples ainda sу /pm mano entendeu .. ?


Re: [Pedido] Sistema de PM - .FuneraL. - 08.04.2012

pawn Код:
if(strcmp(cmd,"/pm",true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, 0xFF6347AA, "[USO CORRETO:]Digite /PM [ID] [Mensagens]");
            return 1;
        }
        new playa;
        new message[128];
        if(IsNumeric(tmp))
        {
            playa = strval(tmp);
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "Esse ID nгo esta ativo no Momento!");
            return 1;
        }
        if(!IsPlayerConnected(playa))
        {
            SendClientMessage(playerid, COLOR_RED, "Esse ID nгo esta ativo no Momento!");
            return 1;
        }
        if(playa == playerid)
        {
            SendClientMessage(playerid, COLOR_RED, "Vocк nгo pode mandar Mensagens Privadas para vocк mesmo!");
            return 1;
        }
        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, 0xFF6347AA, "PM: Vocк tem que digitar o texto da mensagem");
            return 1;
        }
        format(message,sizeof(message),"PM Recebida de %s[%d]: %s",oGetPlayerName(playerid),playerid,result);
        GameTextForPlayer(playa, "~p~MENSAGEM ~g~RECEBIDA", 5000, 5);
        SendClientMessage(playa, COLOR_GREEN, message);
        PlayerPlaySound(playa,1057,0.0,0.0,0.0);
        format(message,sizeof(message),"PM Enviada para %s[%d]: %s",oGetPlayerName(playa),playa,result);
        GameTextForPlayer(playerid, "~p~MENSAGEM ~r~ENVIADA", 5000, 5);
        SendClientMessage(playerid, COLOR_GREEN, message);
        PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
        return 1;
        }
}
Usa Isso '-'


Re: [Pedido] Sistema de PM - Lucas_HenryK - 08.04.2012

deu bastante erros alguns eu arremei sobrou 7 e nao consigo arrumo

pawn Код:
if (strcmp("/pm", cmdtext, true, 10) == 0)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, -1, "/PM [ID] [Mensagem]");
            return 1;
        }
        new idx;
        new playa;
        new message[250];
        if(IsNumeric(tmp))
        {
            playa = strval(tmp);
        }
        else
        {
            SendClientMessage(playerid, -1, "[ERRO]: Jogador nгo conectado");
            return 1;
        }
        if(!IsPlayerConnected(playa))
        {
            SendClientMessage(playerid, -1, "[ERRO]: Jogador nгo conectado");
            return 1;
        }
        if(playa == playerid)
        {
            SendClientMessage(playerid, -1, "[ERRO]: Vocк nгo pode enviar pm para sн mesmo");
            return 1;
        }
        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, -1, "[ERRO]: Digite uma mensagem! e.e");
            return 1;
        }
        format(message,sizeof(message),"PM de %s[%d]: %s",oGetPlayerName(playerid),playerid,result);
        GameTextForPlayer(playa, " ~n~~n~~n~~n~~b~MENSAGEM RECEBIDA", 5000, 3);
        SendClientMessage(playa, -1, message);
        PlayerPlaySound(playa,1057,0.0,0.0,0.0);
        format(message,sizeof(message),"PM para %s[%d]: %s",oGetPlayerName(playa),playa,result);
        GameTextForPlayer(playerid, "~n~~n~~n~~n~~g~MENSAGEM ENVIADA", 5000, 3);
        SendClientMessage(playerid, -1, message);
        PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
        return 1;
        }
erros:

Код:
C:\Documents and Settings\Lucas\Desktop\GM.pwn(261) : error 017: undefined symbol "tmp"
C:\Documents and Settings\Lucas\Desktop\GM.pwn(261) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Lucas\Desktop\GM.pwn(262) : error 017: undefined symbol "tmp"
C:\Documents and Settings\Lucas\Desktop\GM.pwn(270) : error 017: undefined symbol "IsNumeric"
C:\Documents and Settings\Lucas\Desktop\GM.pwn(272) : error 017: undefined symbol "tmp"
C:\Documents and Settings\Lucas\Desktop\GM.pwn(307) : error 017: undefined symbol "oGetPlayerName"
C:\Documents and Settings\Lucas\Desktop\GM.pwn(311) : error 017: undefined symbol "oGetPlayerName"
C:\Documents and Settings\Lucas\Desktop\GM.pwn(362) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


7 Errors.