[HELP] compile crash
#3

It keeps crashing...neither that helps
I use it to make an admin filterscript and I wanna use it here

Код:
dcmd_akill(playerid, params[])
  if(gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[AKILL])
  {
    new string[100];
    format(string, sizeof(string), "You must be administrator level %d to use that command!", gCommands[AKILL]);
    return SendClientMessage(playerid, COLOUR_ORANGE, string);
  }
  else if(!strlen(params))
    return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /akill [id | name]");
  else
  {
	for new(i = 0; i < length; i++; ) // here
	if(IsPlayerConnected(i) && i != playerid)
	{
	  SetPlayerHealth(id, 0.0);
	  new string[150];
	  format(string, sizeof(string), "You have been admin-killed by administrator \'%s\'.", gPlayerInfo[playerid][PLAYER_NAME]);
	  SendClientMessage(i, COLOUR_ORANGE, string);
	  format(string, sizeof(string), "You have successfully admin-killed player \'%s\'.", gPlayerInfo[id][PLAYER_NAME]);
	  return SendClientMessage(playerid, COLOUR_LIGHTBLUE, string);
	}
	else
	  return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You can not admin-kill yourself or a disconnected player.");
}
also I tried with IsNumeric
Код:
stock IsNumeric(const string[]) //By Jan "DracoBlue" Schьtze (edited by Gabriel "Larcius" Cordes
{
new length=strlen(string);
if(length==0)
{
return 0;
}
for (new i=0; i<length; i++)
{
if (!((string[i] <= '9' && string[i] >= '0') || (i==0 && (string[i]=='-' || string[i]=='+'))))
{
return false;
}
}
return 0;
}
because I dont know any other way to send a client message to the akilled ID,not the one who uses the command...
Reply


Messages In This Thread
[HELP] compile crash - by The_Tough - 30.07.2009, 19:43
Re: [HELP] compile crash - by Khelif - 30.07.2009, 19:45
Re: [HELP] compile crash - by The_Tough - 30.07.2009, 19:55
Re: [HELP] compile crash - by illay - 30.07.2009, 20:22
Re: [HELP] compile crash - by Khelif - 30.07.2009, 20:27
Re: [HELP] compile crash - by kaisersouse - 30.07.2009, 20:31

Forum Jump:


Users browsing this thread: 2 Guest(s)