SA-MP Forums Archive
Any Suggestion? - 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)
+--- Thread: Any Suggestion? (/showthread.php?tid=381182)



Any Suggestion? - Sanady - 28.09.2012

Hello I get bored and I made SendError function.Can anyone give me suggestion how to fix this just do not post the code just via words no code..Thanks

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/error", cmdtext, true, 10) == 0)
    {
        SendError(playerid,"TRY","SMOR");
        return 1;
    }
    return 0;
}
stock SendError(playerid,header,message)
{
    new message[90],header[25],string[100];
    format(string,sizeof(string),"[%s]%s",header,message);
    SendClientMessage(playerid,string);
    return 1;
}
ERROR
Код:
D:\SA-MP Server Stuff\SA-MP Server\filterscripts\error.pwn(91) : error 035: argument type mismatch (argument 2)
D:\SA-MP Server Stuff\SA-MP Server\filterscripts\error.pwn(98) : warning 219: local variable "message" shadows a variable at a preceding level
D:\SA-MP Server Stuff\SA-MP Server\filterscripts\error.pwn(98) : warning 219: local variable "header" shadows a variable at a preceding level
D:\SA-MP Server Stuff\SA-MP Server\filterscripts\error.pwn(100) : error 035: argument type mismatch (argument 2)
D:\SA-MP Server Stuff\SA-MP Server\filterscripts\error.pwn(96) : warning 203: symbol is never used: "message"
D:\SA-MP Server Stuff\SA-MP Server\filterscripts\error.pwn(96) : warning 203: symbol is never used: "header"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.



Re: Any Suggestion? - zombieking - 28.09.2012

SendClientMessage has got a COLOR parameter, fill that in.
Delete these:
pawn Код:
new message[90],header[25]
Because you already have those as parameters for your function.

+It should be like this:
pawn Код:
stock SendError(playerid,const header[],const message[])



Re: Any Suggestion? - Sanady - 28.09.2012

Quote:
Originally Posted by zombieking
Посмотреть сообщение
SendClientMessage has got a COLOR parameter, fill that in.
Delete these:
pawn Код:
new message[90],header[25]
Because you already have those as parameters for your function.

+It should be like this:
pawn Код:
stock SendError(playerid,const header[],const message[])
Ohh yea thanks for suggestion


Re: Any Suggestion? - zombieking - 28.09.2012

No problem, glad I could help you.