Help . argument type mismatch
#1

Hey Guys .
i wrote a filterscript and when i want to compile i get these errors .
Код:
D:\Downloads\samp03x_svr_R2_win32\pawno\testchat.pwn(27) : warning 219: local variable "text" shadows a variable at a preceding level
D:\Downloads\samp03x_svr_R2_win32\pawno\testchat.pwn(28) : warning 202: number of arguments does not match definition
D:\Downloads\samp03x_svr_R2_win32\pawno\testchat.pwn(28) : warning 202: number of arguments does not match definition
D:\Downloads\samp03x_svr_R2_win32\pawno\testchat.pwn(28) : error 035: argument type mismatch (argument 1)
D:\Downloads\samp03x_svr_R2_win32\pawno\testchat.pwn(31) : error 008: must be a constant expression; assumed zero
D:\Downloads\samp03x_svr_R2_win32\pawno\testchat.pwn(31) : error 008: must be a constant expression; assumed zero
D:\Downloads\samp03x_svr_R2_win32\pawno\testchat.pwn(34) : warning 202: number of arguments does not match definition
D:\Downloads\samp03x_svr_R2_win32\pawno\testchat.pwn(34) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
PAWNO codes :

pawn Код:
#include <a_samp>
#include <dudb>

#define fsname "Ranks In Chat By Dir[3]ect[0]r"

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Ranks In Chat By Dir[3]ect[0]r");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    print("Ranks In Chat By Dir[3]ect[0]r Unloaded ...");
    return 1;
}

public OnPlayerText(playerid, text[])
{

    new text[1024];
    if(udb_Exists(GetPlayerName(playerid)))      <<<< --> This Line : Error 035
    {
        new
        AdminLevel[playerid] = dUserINT(GetPlayerName(playerid)).("Adminlevel");           <<<< --> This Line : 008
        if (AdminLevel[playerid] > 0)
        {
            format(text, sizeof(text), "{FF0000}[ADMIN]%s[%s] {ffff00}: {FFFFFF}%s",GetPlayerColor(playerid),GetPlayerName(playerid), text);
            SendClientMessageToAll(playerid,text);
        }
    }
    return 0;
}
Can Someone Help ?
Reply
#2

It has lots of mistakes, you haven't define player names and also you need to put GetPlayerColor(playerid) on SendClientMessageToAll instead of playerid, use

pawn Код:
new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
And replace GetPlayerName(playerid) that you have placed on format line with name only.

Sorry i would take a look at your fa but i am using phone ;3
Reply
#3

GetPlayerName returns the lenght of the player's name and what it expects is a string, not an integer. So store the name to a variable by reference like it shows the SA-MP Wiki: https://sampwiki.blast.hk/wiki/GetPlayerName

Also there's already a parameter called text and you create a new array (string) with the same name, use another name and the max lenght of a client message is 144, do NOT use 1024.
Reply
#4

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
GetPlayerName returns the lenght of the player's name and what it expects is a string, not an integer. So store the name to a variable by reference like it shows the SA-MP Wiki: https://sampwiki.blast.hk/wiki/GetPlayerName

Also there's already a parameter called text and you create a new array (string) with the same name, use another name and the max lenght of a client message is 144, do NOT use 1024.
Oh . I can say i don't understand last part .
Can u Edit the Pawn code and Correct the mistakes ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)