#include - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: #include (
/showthread.php?tid=109973)
#include -
[HKS]dlegend - 23.11.2009
i have been told that it is possable to include pwn files (not filterscripts) but like store the cmds in a pwn file then include it under onplayerconnect how would this be done
thanks
ps: need this to make my gm smaller
Re: #include -
Outbreak - 23.11.2009
pawn Код:
public OnPlayerCommandText(playerid, cmdtext)
{
dcmd(kill,4,cmdtext);
return 0;
}
Now normally you'd write the command here... Below OnPlayerCommandText li
dcmd_kill(playerid, params[])
{
#pragma unused params
SetPlayerHealth(playerid, 0);
return 1;
}
instead, write the commands in another file, save it as pwn file. So it could be plcmds.pwn
So now it would look like this..
pawn Код:
public OnPlayerCommandText(playerid, cmdtext)
{
dcmd(kill,4,cmdtext);
return 0;
}
#include "gmfiles/plcmds.pwn"
That #include like assumes you create a folder with the plcmds.pwn file inside. its easier i find to do it that way, rather than clutter up the gamemode folder.