SA-MP Forums Archive
PM help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: PM help (/showthread.php?tid=203682)



PM help - xir - 27.12.2010

This is the script and I get 2 errors http://pastebin.com/ehQVp3xv

Quote:

E:\GTA San Andreas\Server\filterscripts\PM.pwn(37) : error 020: invalid symbol name ""
E:\GTA San Andreas\Server\filterscripts\PM.pwn(3 : error 020: invalid symbol name ""
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.

please help me


Re: PM help - iJumbo - 27.12.2010

https://sampwiki.blast.hk/wiki/GetPlayerName


read this


Re: PM help - xir - 27.12.2010

i dont really understand it :S can you pls fix it ?


Re: PM help - blackwave - 27.12.2010

Learn the basic at least........

Here the script:

pawn Код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>

#define FILTERSCRIPT
#if defined FILTERSCRIPT

#define Yellow 0xFFFF00AA
#define Red    0xFF0000AA

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#endif

CMD:pm(playerid, params[])
{
    new str[256], str2[256], id, idx, player;
    if(sscanf(params, "us", id, str2))
    {
        SendClientMessage(playerid, Yellow, "Usage: /pm <playerid> <message>");
        return 1;
    }
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, Red, "ERROR: Player not connected");
    if(playerid == id) return SendClientMessage(playerid, Red, "ERROR: You cannot pm yourself!");
    {
        GetPlayerName(playerid, player, sizeof(playerid));
        GetPlayerName(id, idx, sizeof(idx));
        format(str, sizeof(str), "PM sent to %s(ID: %d): %s", id, str2);
        SendClientMessage(playerid, 0xFF0000FF, str);
        format(str, sizeof(str), "PM from %s(ID: %d): %s", playerid, str2);
        SendClientMessage(id, Yellow, str);
    }
    return 1;
}



Re: PM help - xir - 27.12.2010

Quote:

E:\GTA San Andreas\Server\filterscripts\PM.pwn(37) : error 035: argument type mismatch (argument 2)
E:\GTA San Andreas\Server\filterscripts\PM.pwn(37) : error 035: argument type mismatch (argument 2)
E:\GTA San Andreas\Server\filterscripts\PM.pwn(3 : error 035: argument type mismatch (argument 2)
E:\GTA San Andreas\Server\filterscripts\PM.pwn(3 : error 035: argument type mismatch (argument 2)
E:\GTA San Andreas\Server\filterscripts\PM.pwn(2 : warning 203: symbol is never used: "player"
E:\GTA San Andreas\Server\filterscripts\PM.pwn(2 : warning 203: symbol is never used: "idx"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Whats wrong ?


Re: PM help - MadeMan - 27.12.2010

pawn Код:
CMD:pm(playerid, params[])
{
    new str[128], str2[128], id;
    if(sscanf(params, "us", id, str2)) return SendClientMessage(playerid, Yellow, "Usage: /pm <playerid> <message>");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, Red, "ERROR: Player not connected");
    if(playerid == id) return SendClientMessage(playerid, Red, "ERROR: You cannot pm yourself!");
    new iName[24], pName[24];
    GetPlayerName(id,iName,sizeof(iName));
    GetPlayerName(playerid,pName,sizeof(pName));
    format(str, sizeof(str), "PM sent to %s(ID: %d): %s", iName, id, str2);
    SendClientMessage(playerid, 0xFF0000FF, str);
    format(str, sizeof(str), "PM from %s(ID: %d): %s", pName, playerid, str2);
    SendClientMessage(id, Yellow, str);
    return 1;
}



Re: PM help - xir - 27.12.2010

Mademan, it compiled with no problem, but it didnt work ingame :S Why ??


Re: PM help - _rAped - 28.12.2010

Quote:
Originally Posted by xir
Посмотреть сообщение
Mademan, it compiled with no problem, but it didnt work ingame :S Why ??
Because you didn't define the variable `id`?


Re: PM help - Lorenc_ - 28.12.2010

Quote:
Originally Posted by _rAped
Посмотреть сообщение
Because you didn't define the variable `id`?
wut?
its already defined in the cmd :S


Re: PM help - _rAped - 28.12.2010

Quote:
Originally Posted by Lorenc_
Посмотреть сообщение
wut?
its already defined in the cmd :S
That's my bad, try making a new variable and use ReturnUser();