PDA

View Full Version : Command problem


xalyy
26/11/2011, 01:49 PM
Hello!

On my server when I type a command like /stats or something the server shut down immediately.
How can I fix it?
Thanks

sabretur
26/11/2011, 01:50 PM
Type here your code, then all clear will be.

Mr_Scripter
26/11/2011, 01:50 PM
show you /stats command
This forum requires that you wait 120 seconds between posts. Please try again in 20 seconds.

Kostas'
26/11/2011, 01:51 PM
Look at your code, it might crashed for something worng there is on this.

xalyy
26/11/2011, 01:53 PM
This is my OnPlayerCommandText:

public OnPlayerCommandText(playerid, cmdtext[])
{
new x_job[256];
new string[256];
new playermoney;
if(AdminDuty[playerid] == 1) SetPlayerChatBubble(playerid, "Admin szolgálatban", COLOR_LIGHTBLUE,20,1200);
new sendername[MAX_PLAYER_NAME];
new giveplayer[MAX_PLAYER_NAME];
new playername[MAX_PLAYER_NAME];
new cmd[256];
new tmp[256];
new giveplayerid, moneys, idx;
new idcar = GetPlayerVehicleID(playerid);
new rapstyle, wankstyle, stripstyle, dancestyle, sexstyle, bjstyle;
cmd = strtok(cmdtext, idx);

GetPlayerName(playerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "%s: ID:%d CMD: %s", giveplayer, playerid, cmdtext);
CMDLog(string);

if(RegistrationStep[playerid] > 0)
{
SmallLifeMessage(playerid, COLOR_LIGHTRED, " Nem tudod ezt csinálni jelenleg !");
return 1;
}

if(BenchPresses[playerid] != 0)
{
SmallLifeMessage(playerid, COLOR_LIGHTRED, "Nem tudod használni ezt amikor padon vagy.");
return 1;
}

xalyy
26/11/2011, 04:05 PM
So what I need to do to fix it? :(

Joshb93
26/11/2011, 04:08 PM
You have a infinite loop in your script, try removing this

GetPlayerName(playerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "%s: ID:%d CMD: %s", giveplayer, playerid, cmdtext);
CMDLog(string);

xalyy
26/11/2011, 04:14 PM
And If i remove what it does?

I removed but it keeps shutting down ;(

Joshb93
26/11/2011, 04:15 PM
It should remove the loop, if there is one, just try..

xalyy
26/11/2011, 04:17 PM
I removed but it keeps shutting down ;(

Joshb93
26/11/2011, 04:18 PM
Hmm... Show the entire code, are you returning the funtion?

xalyy
26/11/2011, 04:22 PM
What you mean about entire code? And do you have an availability?

xalyy
27/11/2011, 01:48 PM
I fixed it but now other problem :S No object in the sever :(