C:\Documents and Settings\bob\Desktop\Ls-Dm\gamemodes\stunt.pwn(1146) : warning 235: public function lacks forward declaration (symbol "OnPlayerPrivmsg")
pawn Код:
public OnPlayerPrivmsg(playerid, recieverid, text[])
    new temp[256];
    format(temp, sizeof(temp), "%s -> %s: %s",Player(playerid), Player(recieverid), text);

    for(new e=0; e<MAX_PLAYERS; e++)
        if(IsPlayerAdmin(e) && e != playerid && e != recieverid)
            SendClientMessage(e, COLOR_YELLOW, temp);
    return 1;
whats worng

Haven't you already read the warning in the wiki page?

Originally Posted by Wiki
Warning: This callback was removed in SA-MP 0.3. See below how to create a /pm command.
There's a example /pm command in the same page.

OnPlayerPrivmsg was remove since 0.3 SAMP

- Base on Wiki.

You can make Read PM system on PM command too.

Since this has been removed you can use some other PM Command and if you want logs of PM Command just do this.
pawn Код:
CMD:pm(playerid, params[])
    new str[256], str2[128], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
    if(sscanf(params, "us[128]", id, str2))
        SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /pm [playerid] [message]");
        return 1;
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFFFF00AA, "ERROR: Player not connected");
    if(playerid == id) return SendClientMessage(playerid, 0xFFFF00AA, "ERROR: You cannot pm yourself!");
    if(GetPVarInt(id, "BlockPM") == 1) return SendClientMessage(playerid, 0xFFFF00AA, "The player don't want anyone PM his/her");
    GetPlayerName(playerid, Name1, sizeof(Name1));
    GetPlayerName(id, Name2, sizeof(Name2));
    format(str, sizeof(str), "pm sent To %s(ID %d): %s", Name2, id, str2);
    SendClientMessage(playerid, COLOR_YELLOW, str);
    format(str, sizeof(str), "PM From %s(ID %d): %s", Name1, playerid, str2);
    SendClientMessage(id, COLOR_YELLOW, str);
    new File:log = fopen("/ServerLog.txt", io_append);
    format(str, sizeof(str), "pm received from %s to %s: %s\r\n", Name1, Name2, str2);
    fwrite(log, str);
    return 1;
make a ServerLog.txt in your scriptfiles folder.

Forum Jump:

Users browsing this thread: 1 Guest(s)