Problem with PM system.
#1

Hey, i have a little problem.
When i write a PM with my script, its do not show my name.

My name in the game is SOAD, and when i write a PM it shows only
PM from S: [.....]

there is my litle code :>
pawn Код:
new aname[MAX_PLAYER_NAME],string[256];
            GetPlayerName(playerid, aname, sizeof(aname));
            GetPlayerName(playerid, aname, sizeof(playerid));
            format(string, sizeof(string), "PM from %s: %s", aname, inputtext);
            SendClientMessage(playerid,0x0ffffff, string);
            new name[MAX_PLAYER_NAME];
            GetPlayerName(playerid, name, sizeof(name));
            format(string, sizeof(string), "You send to %s this message:\n %s", aname, inputtext);
            ShowPlayerDialog(playerid, 444, DIALOG_STYLE_MSGBOX, "Message:",string, "Ok", "Close" );

Reply
#2

Not sure, but try;

pawn Код:
new aname[MAX_PLAYER_NAME],string[256];
GetPlayerName(playerid, aname, sizeof(aname));
format(string, sizeof(string), "PM from %s: %s", aname, inputtext);
SendClientMessage(playerid,0x0ffffff, string);
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "You send to %s this message:\n %s", aname, inputtext);
ShowPlayerDialog(playerid, 444, DIALOG_STYLE_MSGBOX, "Message:",string, "Ok", "Close" );
Did it work?
Reply
#3

ah thx its works

but btw.
I see my skript is wrong.

Its sends the MSG to me not to the other.
What to change?

Reply
#4

Can you post the complete /pm command?
Reply
#5

Quote:
Originally Posted by Jeffry
Can you post the complete /pm command?
What he said.


I see a couple things wrong, 1. Your getting the same player name twice, 2. You over writting the old name with the newly obtained one, 3. i dont see a tragetid for the receiving playerid anywhere.

If you're OnPlayerClickPlayer to show this pm dialog, store the id of the clicked player before.
Reply
#6

Yesterday i lost my logics

pawn Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source){
    c_var[playerid] = clickedplayerid;
pawn Код:
if(dialogid == Nachricht)
    {
      if(response == 1)
      {
        new aname[MAX_PLAYER_NAME],string[256];
        GetPlayerName(playerid, aname, sizeof(aname));
        format(string, sizeof(string), "PM from %s: %s", aname, inputtext);
        SendClientMessage( c_var[playerid],0x0ffffff, string);
        new name[MAX_PLAYER_NAME];
        GetPlayerName(c_var[playerid], name, sizeof(name));
        format(string, sizeof(string), "You send to %s this message:\n %s", aname, inputtext);
        ShowPlayerDialog(playerid, 444, DIALOG_STYLE_MSGBOX, "Message:",string, "Ok", "Close" );
        }
    }
But now i have a other problem.

pawn Код:
if(listitem == 2){
                new Float:x, Float:y, Float:z;
                GetPlayerPos(c_var[playerid], x, y, z);
                SetPlayerPos(playerid, x+2, y+2, z+2);
                new pint = GetPlayerInterior(playerid);
                SetPlayerInterior(c_var[playerid], pint);
                if(IsPlayerInAnyVehicle(playerid))
            {
              new plveh = GetPlayerVehicleID(playerid);
              SetVehiclePos(plveh, x+2, y+2, z+2);
              PutPlayerInVehicle(playerid, plveh, 0);
                }
                new string[128];
                new name[MAX_PLAYER_NAME];
            GetPlayerName(playerid, name, sizeof(name));
            format(string, 128, "Du hast dich erfolgreich zu %s geportet!",c_var[playerid]);
            ShowPlayerDialog(playerid, 333, DIALOG_STYLE_MSGBOX, "Butler:",string, "Ok", "SchlieЯen" );
                }
Idk. whats wrong, but the other became a crash, when i teleport to thim/write to them or give them Money.

Is the error in my script, or in the gradlarc GM from SA:MP ?
Reply
#7

Nice that you fixed the /pm.
With the teleport I cant help you.
I cant find anything bad.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)