Where do I declare my gamemode?
#1

I made a script, gamemode.pwn lets call it. What file do I write for the server to load it?
Reply
#2

Well to run server.exe you need the .amx to run the gamemode. Is this what you asked?
Reply
#3

I need the .amx? Alright so I compile to get that then.

But no, my question is: where do I write down the filename so the server knows to load it?
Reply
#4

Oh you write it in the server.cfg for example
Код:
echo Executing Server Config...
lanmode 0
rcon_password rconpass
maxplayers 20
port 7777
hostname SA-MP 0.3 Server
gamemode0 Gamemodenamehere 1
filterscripts 
announce 1
plugins 
query 1
chatlogging 0
weburl www.sa-mp.com
onfoot_rate 40
incar_rate 40
weapon_rate 40
stream_distance 300.0
stream_rate 1000
maxnpc 0
logtimeformat [%H:%M:%S]
Reply
#5

Thanks, what does this mean by the way:

error 021: symbol already defined: "OnPlayerCommandText"
Reply
#6

"OnPlayerCommandText" Is defined twice.
Reply
#7

Um... what is the problem with that?

Also, how do I now start and test my server, locally?
Reply
#8

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/mycommand", cmdtext, true, 10) == 0)
	{
		// Do something here
		return 1;
	}
	return 0;
}
You have this code 2 times if your making another command all you do is
when adding another command add it under public on play commandtext and it should do the trick so remove if you have more than 1 ublic on player command text
For example
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/mycommand", cmdtext, true, 10) == 0)
	{
		// Do something here
		return 1;
	}

         if (strcmp("/mycommand2", cmdtext, true, 10) == 0)
	{
		// Do something herefg
		return 1;
	}
	return 0;
}
Reply
#9

Yup I sorted that, but how do I test my server locally now?
Reply
#10

Run the server.exe and go on sa-mp and add :7777 to your server list but make sure you have 7777 for port on the server cfg
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)