Getting some error while compiling ??
#1

Hey there i get an error which is unknown to me so that i need help of you guys.
pawn Код:
public OnPlayerCommandPerformed(playerid, success)
{
    new string[128];
    format(string, sizeof(string), "[cmd] [%s]: %s", SenderName, result); // this line is buggy.
    print(string);
        if(!success)
    {
        SendClientMessage(playerid, COLOR_GREY, "** Sorry you have entered a command that doesnt exist.");
    }

    return 1;
}
It says invalid function call i have marked the line where i get error.
Reply
#2

I guess, that 'SenderName' is not a variable, but functions name.
Reply
#3

try to change SenderName to GetPlayerName ?
Reply
#4

No dude i have explained GetPlayerName as SenderName in my stock so that shouldnt be the reason any idea?
Reply
#5

and what is "result"? any stock?
Reply
#6

no stock for result lol
Reply
#7

Then what is it(result)?
Reply
#8

pawn Код:
stock Name(playerid)
{
    new string[72];
    GetPlayerName(playerid, string, sizeof(string));
    return string;
}
Use name instead of sendername.
Reply
#9

If SenderName is stock, use opened/closed parentheses and its parameters (if it has any). Otherwise it will try to call an invalid function like the error says.
Reply
#10

fixed it anyhow thanks guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)