04.04.2015, 19:21
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.
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![Cheesy](images/smilies/biggrin.png)
oh right, also this is where I declare variable for currentJob:
Just below includes and defines.
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; }
![Smiley](images/smilies/smile.png)
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
![Cheesy](images/smilies/biggrin.png)
oh right, also this is where I declare variable for currentJob:
Код:
new currentJob[30] = "Unemployed";