PM help
#1

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

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


read this
Reply
#3

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

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;
}
Reply
#5

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 ?
Reply
#6

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;
}
Reply
#7

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

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`?
Reply
#9

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

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();
Reply


Forum Jump:


Users browsing this thread: 7 Guest(s)