SA-MP Forums Archive
Filterscript aint working - 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: Filterscript aint working (/showthread.php?tid=343653)



Filterscript aint working - miley1 - 18.05.2012

Filterscript Make all other commands not work Whats wrong


PHP код:
// Area 51 lift System, Made by Tom.1412
// Don't remove credits
// If you want more Doors/Gates made, Message me on samp.
#include <a_samp>
#define FILTERSCRIPT
#define Error_Color 0xAA3333AA
#define Message_Close_Color 0x33AA33AA
#define Close_Message " Welcome Home Wizzard! (Gates Created By Kepa) "
#if defined FILTERSCRIPT
#endif
new Gate1a;
forward CloseGate1AtoD(playerid);
forward CloseGate2AnB(playerid);
public 
OnFilterScriptInit()
{
    print(
"\n--------------------------------------");
    print(
" wizarddoor");
    print(
"--------------------------------------\n");
    
Gate1a CreateObject(971,321.10000610,-1188.59997559,76.30000305,0.00000000,0.00000000,38.00000000);
    return 
1;
}
public 
CloseGate1AtoD(playerid)
{
    
MoveObject(Gate1a138.0488281251946.974609375181);
    
SendClientMessage(playeridMessage_Close_ColorClose_Message);
    return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if(!
strcmp(cmdtext"/wizdoor"true))
    {
        if(
IsPlayerInRangeOfPoint(playerid10.0321.10000610, -1188.5999755976.30000305))
         {
            
MoveObject(Gate1a321.10000610, -1188.5999755976.300003051);
            
SetTimer("CloseGate1AtoD"10000false);
        }
        else 
SendClientMessage(playeridError_Color" You Are Not Near Wiz House.");
    }
     return 
1;




Re: Filterscript aint working - emokidx - 18.05.2012

are you using zcmd in other commands?
if yes, then change this one too to zcmd.


Re: Filterscript aint working - miley1 - 18.05.2012

Please explain some more and how i change it


Re: Filterscript aint working - milanosie - 18.05.2012

if(!strcmp(cmdtext, "/wizdoor", true))



ZMC:wizdoor(playerid, params[])
But since you use a ravens edit I dont think you use ZCMD,


And why make it a filterscript?
Just copy it to your gamemode


Re: Filterscript aint working - Flake. - 18.05.2012

Quote:
Originally Posted by miley1
Посмотреть сообщение
Please explain some more and how i change it
by using zcmd and the standard cmd together they mess each other up and make all of the commands not work


Re: Filterscript aint working - [KHK]Khalid - 18.05.2012

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/wizdoor", true))
    {
        if(IsPlayerInRangeOfPoint(playerid, 10.0, 321.10000610, -1188.59997559, 76.30000305))
        {
            MoveObject(Gate1a, 321.10000610, -1188.59997559, 76.30000305, 1);
            SetTimer("CloseGate1AtoD", 10000, false);
        }
        else SendClientMessage(playerid, Error_Color, " You Are Not Near Wiz House.");
    }
     return 0; // it was 1, I changed it to 0 as it is a filterscript
}
Edit: commands in filterscripts look like that
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
         if(.........)
         {
                  // your command stuff here
                  return 1;
         }
         return 0; // OnPlayerCommandText should return 0 in filterscripts
}