SA-MP Forums Archive
Can anyone help me? - 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: Can anyone help me? (/showthread.php?tid=359513)



Can anyone help me? - shaniyal - 14.07.2012

so i was making a script i got some error but i fixed but i dnt know why its not working.
Код:
#include <a_samp>
#include <streamer>
#if defined FILTERSCRIPT
#define announce
public OnFilterScriptInit()
 announce(playerid,params[]) {
    if(PlayerInfo[playerid][Level] >= 1) {
        CMDMessageToAdmins(playerid,"ANNOUNCE");
    	if(!strlen(params)) return SendClientMessage(playerid,red,"Syntax Error: \"/ANNOUNCE <TEXT>\".");
		return GameTextForAll(params,4000,3);
    } else return SendClientMessage(playerid,red,"ERROR: You need to be level 1 to use this command");
}

#endif
i am telling u whole script so it wil be easy to help me.


Re: Can anyone help me? - Jochemd - 14.07.2012

Tell us the errors. I see a couple of wrong things but I want the errors.


Re: Can anyone help me? - shaniyal - 14.07.2012

it give me no error
Код:
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase



Re: Can anyone help me? - Jochemd - 14.07.2012

Quote:
Originally Posted by shaniyal
Посмотреть сообщение
it give me no error
Код:
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
If you used my code it won't give you errors indeed. Though I am unsure what the announce function is. Is it some custom function?


Re: Can anyone help me? - shaniyal - 14.07.2012

u know about Luxadmin i was looking in his script and i found this announce so i copied it AND tryed to made my own script i made but it was giving me some errors first but when i fixed it and i puted it,i didnt work but if u need that .pwn file than i made i will send the link,do u want?


Re: Can anyone help me? - shaniyal - 14.07.2012

anyone know this?


Re: Can anyone help me? - Andi_Evandy - 14.07.2012

Try this:
pawn Код:
#include <a_samp>
#include <streamer>
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#if defined FILTERSCRIPT

public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(announce, 8, cmdtext);
    return 0;
}

dcmd_announce(playerid, params[])
{
    if(PlayerInfo[playerid][Level] >= 1)
    {
        CMDMessageToAdmins(playerid,"ANNOUNCE");
        if(!strlen(params)) return SendClientMessage(playerid,red,"Syntax Error: \"/ANNOUNCE <TEXT>\".");
        return GameTextForAll(params,4000,3);
    }
    else return SendClientMessage(playerid,red,"ERROR: You need to be level 1 to use this command");
}
#endif



Re: Can anyone help me? - shaniyal - 14.07.2012

thx for helping me but if i get some problems i will contact u thx


Re: Can anyone help me? - shaniyal - 14.07.2012

no sorry i didnt work


Re: Can anyone help me? - Andi_Evandy - 14.07.2012

make sure you've "#define FILTERSCRIPT" in the top of the script