#1

Hi, i have some problems with my /kill command. I cannot compile because of some errors.

Код:
C:\Users\****\Documents\USB\Mods\samp02Xserver.win32\gamemodes\gf.pwn(8137) : warning 217: loose indentation
C:\Users\****\Documents\USB\Mods\samp02Xserver.win32\gamemodes\gf.pwn(8137) : error 029: invalid expression, assumed zero
C:\Users\****\Documents\USB\Mods\samp02Xserver.win32\gamemodes\gf.pwn(8138) : error 001: expected token: ";", but found "{"
C:\Users\****\Documents\USB\Mods\samp02Xserver.win32\gamemodes\gf.pwn(8141) : error 017: undefined symbol "jailed2"
C:\Users\****\Documents\USB\Mods\samp02Xserver.win32\gamemodes\gf.pwn(8141) : warning 215: expression has no effect
C:\Users\****\Documents\USB\Mods\samp02Xserver.win32\gamemodes\gf.pwn(8141) : error 001: expected token: ";", but found "]"
C:\Users\****\Documents\USB\Mods\samp02Xserver.win32\gamemodes\gf.pwn(8141) : error 029: invalid expression, assumed zero
C:\Users\****\Documents\USB\Mods\samp02Xserver.win32\gamemodes\gf.pwn(8141) : fatal error 107: too many error messages on one line
And this is the script :

Код:
public OnPlayerCommandText(playerid, cmdtext)
{
  if(strcmp(cmdtext, "/kill", true) == 0)
  {
    if (jailed2[playerid] == 1)
    {
      SendClientMessage(playerid,COLOR_GRAD1,"You cannot kill yourself because you're in the jail.");
    }
    else
    {
      SetPlayerHealth(playerid, 0.0);
      GetPlayerName(playerid,playername,sizeof(playername));
      format(string,sizeof(string),".: %s Has killed himself (/kill) :.",playername);
      SendClientMessageToAll(COLOR_RED,string);
    }
    return 1;
  }
  return 0;
}
What is wrong ?
Reply
#2

pawn Код:
//top fo script
new jailed2[MAX_PLAYERS];
Reply
#3

I done what you say, but i have another error.

Код:
C:\Users\****\Documents\USB\Mods\samp02Xserver.win32\gamemodes\gf.pwn(8137) : warning 217: loose indentation
C:\Users\****\Documents\USB\Mods\samp02Xserver.win32\gamemodes\gf.pwn(8137) : error 029: invalid expression, assumed zero
C:\Users****\Documents\USB\Mods\samp02Xserver.win32\gamemodes\gf.pwn(8138) : error 001: expected token: ";", but found "{"
C:\Users\****\Documents\USB\Mods\samp02Xserver.win32\gamemodes\gf.pwn(8145) : error 029: invalid expression, assumed zero
C:\Users\****\Documents\USB\Mods\samp02Xserver.win32\gamemodes\gf.pwn(8141) : warning 204: symbol is assigned a value that is never used: "jailed2"
C:\Users****\Documents\USB\Mods\samp02Xserver.win32\gamemodes\gf.pwn(8157) : warning 225: unreachable code
C:\Users\****\Documents\USB\Mods\samp02Xserver.win32\gamemodes\gf.pwn(8157) : warning 217: loose indentation
And this is the 'new' script:

Код:
public OnPlayerCommandText(playerid, cmdtext)
{
  if(strcmp(cmdtext, "/kill", true) == 0)
  {
    new jailed2[MAX_PLAYERS];
    {
      SendClientMessage(playerid,COLOR_GRAD1,"You cannot kill yourself because you're in the jail.");
    }
    else
    {
      SetPlayerHealth(playerid, 0.0);
      GetPlayerName(playerid,playername,sizeof(playername));
      format(string,sizeof(string),".: %s Has killed himself (/kill) :.",playername);
      SendClientMessageToAll(COLOR_RED,string);
    }
    return 1;
  }
  return 0;
}
Reply
#4

Reply
#5

Код:
public OnPlayerCommandText(playerid, cmdtext)
{
  new jailed2[200];
  if(strcmp(cmdtext, "/kill", true) == 0)
  {
    if (jailed2[playerid] == 1)
    {
     SendClientMessage(playerid,COLOR_GRAD1,"You cannot kill yourself because you're in the jail.");
    }
    else
    {
      SetPlayerHealth(playerid, 0.0);
      GetPlayerName(playerid,playername,sizeof(playername));
      format(string,sizeof(string),".: %s Has killed himself (/kill) :.",playername);
      SendClientMessageToAll(COLOR_RED,string);
    }
    return 1;
  }
  return 0;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)