Server crashes while trying to execute command
#1

Hello, I am new to pawn, so I made a command "/job" and I was getting numerous weird errors, so I set string to "Unemployed" and insert it to SendClientMessage with %s (see examples below) but every time I get in game and type /job, server stops responding, and when I alt tab server is crashed. here is an example from my code.

Here is function for command.
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/job", cmdtext, true, 10) == 0)
	{
		// Do something here
        SendClientMessage(playerid, 0x00FF00FF, "Current job: %s", currentJob);
		return 1;
	}
	return 0;
}
I am not sure what is happening, but I've been struggling to fix this for hours, help would be appreciated .

I get no compiler errors, just two warnings, and one is pretty relevant, and it points to Send Client message thing, it is "warning 202: number of arguments does not match definition".

I am probably making really stupid mistake

oh right, also this is where I declare variable for currentJob:
Код:
new currentJob[30] = "Unemployed";
Just below includes and defines.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)