Would i be able to do this?
#1

Would i be able to put all my commands into a include?
Then include it on my gamemode?
Reply
#2

joining the question
________
Free Gift Card
Reply
#3

i guess you can put the stuff of the command in an include, but you need to put the " strcmp" thing or dcmd, or whatever you'll using in a fs or GM so commands will be only 4 lines .... like

if(strcmp(cmd, "/test", true) == 0)
{
IncludeFunction(param1,param2);
}
Reply
#4

Yes,
On your .pwn at the top add:
Код:
#include "..\script\cmds.inc"
Then goto your server folder, add a script directory and then cmds.inc (This is where the commands are). Inside the .inc add OnPlayerCommandText e.t.c
Reply
#5

If you use a callback in an include file, you can't use the same callback in the .pwn file.
Reply
#6

In your gamemode
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  #include "..\cmds.txt"
  return 0;
}
And in cmds.txt

pawn Код:
if(strcmp(cmdtext, "/givecar", true) == 0)
{
  new Float:x, Float:y, Float:z;
  GetPlayerPos(playerid, x, y, z);
  PutPlayerInVehicle(playerid, CreateVehicle(411, x, y, z, 0.0, -1, -1, -1), 0);
  return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)