[Pedido] Sistema de PM
#1

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
Reply
#2

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

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

alguem ??
Reply
#5

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

entendi nada.
Reply
#7

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
Reply
#8

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

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 '-'
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)