Samp Pm Help!
#1

Hello Everyone my server using lux Admin pm so the problem is the pm is in dialog i don't wan't it in dialog please can anyone help me with that

This is the code =

PHP код:
dcmd_pm(playerid,params[])
{
    if(!
strlen(params)) return
    
SendClientMessage(playeridorange"Usage: /pm [PlayerID]");
     
PMplayer1 strval(params);
    if(
PMplayer1 == playerid) return
    
SendClientMessage(playeridwhite"ERROR: {FF0000} You can't send PM to yourself!");
    if(!(
IsPlayerConnected(PMplayer1) && PMplayer1 != INVALID_PLAYER_ID)) return
    
SendClientMessage(playeridwhite"ERROR:  Player not Connected!");
    new 
string[128];
    
GetPlayerName(PMplayer1PmReceiversizeof(PmReceiver));
    
format(string,sizeof(string),"PM To: \"%s(%d)\" \n\nType the message to send:"PmReceiverPMplayer1);
     
ShowPlayerDialog(playerid,DIALOG_TYPE_PM,DIALOG_STYLE_INPUT,"PrivateMessage",string,"Send!","Cancel");
     return 
1;

Reply
#2

pawn Код:
dcmd_pm(playerid,params[])
{
    new id, gMessage[128],Message[128],iName[MAX_PLAYER_NAME], pmName[MAX_PLAYER_NAME];
    new string[256];
    if (sscanf(params, "is",id,gMessage)) return SendClientMessage(playerid, 0x33CCFFAA, "USAGE: /pm <ID> <Message>");
    if(!IsPlayerConnected(id)) {
        SendClientMessage(playerid,0xFF444499,"/pm : Bad player ID");
        return 1;}
    if(playerid == id) {
        SendClientMessage(playerid,0xFF444499,"You cannot PM yourself");
        return 1;}
    if(ServerInfo[ReadPMs] == 1 && AccInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) {
        new recievername[MAX_PLAYER_NAME];
        GetPlayerName(playerid, string, sizeof(string)); GetPlayerName(id, recievername, sizeof(recievername));
        format(string, sizeof(string), "***PM From: %s To %s: %s", string, recievername, gMessage);
        for (new a = 0; a < MAX_PLAYERS; a++) if ((AccInfo[a][Level] >= ServerInfo[MaxAdminLevel]) && a != playerid)
        SendClientMessage(a, grey, string);}
    if(AccInfo[playerid][Muted] == 1) {
        AccInfo[playerid][MuteWarnings]++;
        if(AccInfo[playerid][MuteWarnings] < ServerInfo[MaxMuteWarnings]) {
            format(string, sizeof(string),"WARNING: You are muted, if you continue to speak you will be kicked (Warning: %d/%d)", AccInfo[playerid][MuteWarnings], ServerInfo[MaxMuteWarnings] );
            SendClientMessage(playerid,0xAA3333AA,string);
        } else {
            SendClientMessage(playerid,0xAA3333AA,"You have been warned! Now you have been kicked");
            GetPlayerName(playerid, string, sizeof(string));
            format(string, sizeof(string),"%s [ID %d] Kicked for exceeding mute warnings", string, playerid);
            SendClientMessageToAll(grey,string); Kick(playerid);}
        return 0;}
    GetPlayerName(id,iName,sizeof(iName));
    GetPlayerName(playerid,pmName,sizeof(pmName));
    format(Message,sizeof(Message),"PM To %s(%d): %s",iName,id,gMessage);
    SendClientMessage(playerid,0xFFCC2299,Message);
    format(Message,sizeof(Message),"PM From %s(%d): %s",pmName,playerid,gMessage);
    SendClientMessage(id,0xFFFF22AA,Message);
    PlayerPlaySound(id,1085,0.0,0.0,0.0);
    printf("PM: %s",Message);
    return 1;
}
Reply
#3

Got 1 bug bro in game i went there was only me at the time and i type /pm 0 <msg>
i try to pm my self it again show me the same messahe
pm playerid msg
pelase help
Reply
#4

Can Anyon help please
Reply
#5

pawn Код:
dcmd_pm(playerid, params[])
{
    new id, msg[148],str[148],str1[148];
    if(sscanf(params, "us[81]", id, msg)) return Usage(playerid, "/pm [player] [message]");
    if(msg[80]) return SendClientMessage(playerid, COLOR_RED, "Error! Invalid PM Length. Your PM Must Be Between 1-80 Characters.");
    if(isnull(msg)) return SendClientMessage(playerid, COLOR_RED, "Error! Invalid PM Length. Your PM Must Be Between 1-80 Characters.");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Invalid Player!");
    //if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "You Can Not PM Yourself!");
//uncomment the line above if you want to disable PMing yourself
    else
    {
        format(str,sizeof(str),"PM Sent To %s(%d): %s", pNick(id), id, msg);
        format(str1,sizeof(str1),"PM From %s(%d): %s", pNick(playerid), playerid, msg);
        SendClientMessage(playerid,COLOR_YELLOW,str);
        SendClientMessage(id, COLOR_YELLOW,str1);
        SendClientMessage(id, COLOR_BLUE, "Use /r to reply quickly.");
    }
    return 1;
}
Reply
#6

C:\Users\Family Lover\Desktop\SampServer\Servers\Drift-Universe\filterscripts\LuxAdmin.pwn(3799) : error 017: undefined symbol "Usage"
C:\Users\Family Lover\Desktop\SampServer\Servers\Drift-Universe\filterscripts\LuxAdmin.pwn(3801) : error 017: undefined symbol "isnull"
C:\Users\Family Lover\Desktop\SampServer\Servers\Drift-Universe\filterscripts\LuxAdmin.pwn(3807) : error 017: undefined symbol "pNick"
C:\Users\Family Lover\Desktop\SampServer\Servers\Drift-Universe\filterscripts\LuxAdmin.pwn(380 : error 017: undefined symbol "pNick"
Reply
#7

what are lines 3799 , 3801 and 3807 ?
Reply
#8

3799 - if(sscanf(params, "us[81]", id, msg)) return Usage(playerid, "/pm [player] [message]");
3801- if(isnull(msg)) return SendClientMessage(playerid, red, "Error! Invalid PM Length. Your PM Must Be Between 1-80 Characters.");
3807- format(str,sizeof(str),"PM Sent To %s(%d): %s", pNick(id), id, msg);
Reply
#9

Quote:
Originally Posted by MrCripBloodz
Посмотреть сообщение
3799 - if(sscanf(params, "us[81]", id, msg)) return Usage(playerid, "/pm [player] [message]");
3801- if(isnull(msg)) return SendClientMessage(playerid, red, "Error! Invalid PM Length. Your PM Must Be Between 1-80 Characters.");
3807- format(str,sizeof(str),"PM Sent To %s(%d): %s", pNick(id), id, msg);
You can use your build in gamemode pm command, disable luxadmin pm.
Reply
#10

i think this should work

pawn Код:
dcmd_pm(playerid, params[])
{
    new id, msg[148],str[148],str1[148];
    if(sscanf(params, "us[81]", id, msg)) return SendClientMessage(playerid, 0xFFFFFFFF, "/pm [player] [message]");
    if(msg[80]) return SendClientMessage(playerid, 0xFFFFFFFF, "Error! Invalid PM Length. Your PM Must Be Between 1-80 Characters.");
    if(!strlen(msg)) return SendClientMessage(playerid, 0xFFFFFFFF, "Error! Invalid PM Length. Your PM Must Be Between 1-80 Characters.");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Invalid Player!");
    //if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "You Can Not PM Yourself!");
//uncomment the line above if you want to disable PMing yourself
    else
    {
        new sentname[MAX_PLAYER_NAME], recievedname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, sentname, sizeof(sentname));
        GetPlayerName(id, recievedname, sizeof(recievedname));
       
        format(str,sizeof(str),"PM Sent To %s(%d): %s", recievedname, id, msg);
        format(str1,sizeof(str1),"PM From %s(%d): %s", sentname, playerid, msg);
        SendClientMessage(playerid,0xFFFFFFFF,str);
        SendClientMessage(id, 0xFFFFFFFF,str1);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)