mAdmin help
#1

Hello all,
I am using mAdmin, but when i want to compile it, I always get this error:

Код:
C:\Users\Korisnik\Desktop\test\filterscripts\mAdmin.pwn(531) : warning 235: public function lacks forward declaration (symbol "OnPlayerPrivmsg")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
This is the PAWN code:
pawn Код:
public OnPlayerPrivmsg(playerid, recieverid, text[])
{
    new RecieverName[24], pName[24], str[256];
    GetPlayerName(recieverid, RecieverName, sizeof(RecieverName));
    GetPlayerName(playerid, pName, sizeof(pName));
    format(str, sizeof(str), "* PM from %s (ID: %d) to %s (ID: %d): %s", pName, playerid, RecieverName, recieverid, text);
    SendModMsg(COLOR_LIGHTBLUE, str);
    return 1;
}
Any help will be highly appericiated

Kappa
Reply
#2

You need to go to the "mAdmin" release thread and get help there or try searching to see if someone has some up with a solution to the same, or similar problem.

You need to forward the function by the way...
Reply
#3

Try
PHP код:
forward OnPlayerPrivmsg(playeridrecieveridtext[]); 
Before the function.
Reply
#4

when i replace public with forward, i get alot of warnings
Reply
#5

You don't replace 'public' with 'forward'. Your declaring what the function is and it's set parameters.

Do this:

PHP код:
forward OnPlayerPrivmsg(playeridrecieveridtext[]);  
public 
OnPlayerPrivmsg(playeridrecieveridtext[])
{
    new 
RecieverName[24], pName[24], str[256];
    
GetPlayerName(recieveridRecieverNamesizeof(RecieverName));
    
GetPlayerName(playeridpNamesizeof(pName));
    
format(strsizeof(str), "* PM from %s (ID: %d) to %s (ID: %d): %s"pNameplayeridRecieverNamerecieveridtext);
    
SendModMsg(COLOR_LIGHTBLUEstr);
    return 
1;

Reply
#6

Fixed! Thanks man
Reply
#7

The problem is that function will never be called (unless called somewhere else within the script), as that callback was removed in 0.3c version of SA:MP. Look in the filterscript section for working scripts to integrate PM systems.
Reply
#8

I got new errors

pawn Код:
C:\Users\Korisnik\Desktop\test\filterscripts\mAdmin.pwn(2025) : error 021: symbol already defined: "strtok"
C:\Users\Korisnik\Desktop\test\filterscripts\mAdmin.pwn(2040) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
the code:
pawn Код:
strtok(const string[], &index)
{
        new length = strlen(string);
        while ((index < length) && (string[index] <= ' '))
        {
                index++;
        }

        new offset = index;
        new result[20];
        while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
        {
                result[index - offset] = string[index];
                index++;
        }
        result[index - offset] = EOS;
        return result;
}
help pls
Reply
#9

1st warning = function strtok is already defined, delete your function.

To fix the 2nd warning
pawn Код:
new tmp[ 128 ]; // 128, array size does not match.
tmp = strtok( ... ); // ... = your arguments.
Instead of that, use
pawn Код:
new tmp[ 256 ]; // strtok needs 256.
tmp = strtok( ... ); // ... = your arguments.
better use sscanf.
Reply
#10

Can you edit/upgrade my code because I don't understand you :/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)