SA-MP Forums Archive
I Want To Put The Code Of Fileterscript In MY Gamemode - 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: I Want To Put The Code Of Fileterscript In MY Gamemode (/showthread.php?tid=611580)



I Want To Put The Code Of Fileterscript In MY Gamemode - CarRamper - 08.07.2016

Please tell me how i can transform the code of my fileterscript to my gamemode


Re: I Want To Put The Code Of Fileterscript In MY Gamemode - Dusan01 - 08.07.2016

Hmm, u are beginner, so it will not be easy for you to understand.

But its really easy, just copy from filterscript to gamemode, you copy the code witch is added by owner of fs, you dont need to copy main callbacks. I will give you example:

this will be filterscript:
PHP код:
public OnPlayerConnect(playerid) {
    
SendClientMessage(playerid,-1,"Filterscript");
    return 
1;
    } 
and this will be gamemode:
PHP код:
public OnPlayerConnect(playerid) {
    return 
1;
    } 
and what you only copy is this:
PHP код:
SendClientMessage(playerid,-1,"Filterscript"); 
and final result in you gamemode is:
PHP код:
public OnPlayerConnect(playerid) {
    
SendClientMessage(playerid,-1,"Filterscript");
    return 
1;
    } 
but lets say if you have custom functions in your filterscipt like this:
PHP код:
forward Test123();
public 
Test123() {
    
//some code blaahhh...
    
return 1;
    } 
you will need to copy it whole to your gamemode, like this, this is now how should look like ur gamemode:
PHP код:
public OnPlayerConnect(playerid) {
    
SendClientMessage(playerid,-1,"Filterscript");
    return 
1;
    }
forward Test123();
public 
Test123() {
    
//some code blaahhh...
    
return 1;
    } 
and vars like new,bool... in your filterscript you just copy it to your gamemode...