Error 055 start of function body without function header как исправить

Jump to: navigation, search

From SA-MP Wiki

Jump to: navigation, search

Contents

  • 1 General Pawn Error List
  • 2 Error categories
    • 2.1 Errors
    • 2.2 Fatal errors
    • 2.3 Warnings
  • 3 Common Errors
    • 3.1 001: expected token
    • 3.2 002: only a single statement (or expression) can follow each “case”
    • 3.3 004: function «x» is not implemented
    • 3.4 025: function heading differs from prototype
    • 3.5 035: argument type mismatch (argument x)
    • 3.6 036: empty statement
    • 3.7 046: unknown array size (variable x)
    • 3.8 047: array sizes do not match, or destination array is too small
    • 3.9 055: start of function body without function header
  • 4 Common Fatal Errors
    • 4.1 100: cannot read from file: «<file>»
  • 5 Common Warnings
    • 5.1 202: number of arguments does not match definition
    • 5.2 203: symbol is never used: «symbol»
    • 5.3 204: symbol is assigned a value that is never used: «symbol»
    • 5.4 209: function should return a value
    • 5.5 211: possibly unintended assignment
    • 5.6 213: tag mismatch
    • 5.7 217: loose indentation
    • 5.8 219: local variable «foo» shadows a variable at a preceding level
    • 5.9 225: unreachable code
    • 5.10 235: public function lacks forward declaration (symbol «symbol»)
  • 6 External Links

General Pawn Error List

This pages contains the most common errors and warnings produced by the pawn compiler when creating SA:MP scripts.

When the compiler finds an error in a file, it outputs a message giving, in this order:

  • the name of the file
  • the line number were the compiler detected the error between parentheses, directly behind the filename
  • the error class (error, fatal error or warning)
  • an error number
  • a descriptive error message

For example:

hello.pwn(3) : error 001: expected token: ";", but found "{"

Note: The error may be on the line ABOVE the line that is shown, since the compiler cannot always establish an error before having analyzed the complete expression.

Error categories

Errors are separated into three classes:

Errors

  • Describe situations where the compiler is unable to generate appropriate code.
  • Errors messages are numbered from 1 to 99.

Fatal errors

  • Fatal errors describe errors from which the compiler cannot recover.
  • Parsing is aborted.
  • Fatal error messages are numbered from 100 to 199.

Warnings

  • Warnings are displayed for unintended compiler assumptions and common mistakes.
  • Warning messages are numbered from 200 to 299.

Common Errors

001: expected token

A required token is missing.

Example:

error 001: expected token: ";", but found "return"
main()
{
    print("test") // This line is missing a semi-colon. That is the token it is expecting.
    return 1; // The error states that it found "return", this is this line it is referring to,
    // as it is after the point at which the missing token (in this case the semi-colon) should be.
}

002: only a single statement (or expression) can follow each “case”

Every case in a switch statement can hold exactly one statement.
To put multiple statements in a case, enclose these statements
between braces (which creates a compound statement).

Example:

error 002: only a single statement (or expression) can follow each "case"
main()
{
    switch(x)
    {
        case 0: print("hello"); print("hello");
    }
    return 1;
}

The above code also produces other warnings/errors:

error 002: only a single statement (or expression) can follow each "case"
warning 215: expression has no effect
error 010: invalid function or declaration

Fixed:

main()
{
    switch(x)
    {
        case 0:
        {
            print("hello");
            print("hello");
        }
    }
    return 1;
}

004: function «x» is not implemented

Most often caused by a missing brace in the function above.

025: function heading differs from prototype

This usually happen when new sa-mp version comes with new addition of argument to a function, like OnPlayerGiveDamage from 0.3x to 0.3z. The scripter must add «bodypart» argument to OnPlayerGiveDamage callback on their script.

Caused by either the number of arguments or the argument name is different.

Example:

forward MyFunction(playerid);
 
public MyFunction(player, vehicleid)

Fixed:

forward MyFunction(playerid, vehicleid);
 
public MyFunction(playerid, vehicleid)

035: argument type mismatch (argument x)

An argument passed to a function is of the wrong ‘type’.
For example, passing a string where you should be passing an integer.

Example:

error 035: argument type mismatch (argument 1)
Kick("playerid"); // We are passing a STRING, we should be passing an INTEGER

Fixed:

Kick(playerid);

036: empty statement

Caused by a rogue semicolon (;), usually inadvertently placed behind an if-statement.

046: unknown array size (variable x)

For array assignment, the size of both arrays must be explicitly defined, also if they are passed as function arguments.

Example:

new string[];
string = "hello";

Fixed:

new string[6];
string = "hello";

047: array sizes do not match, or destination array is too small

For array assignment, the arrays on the left and the right side of the
assignment operator must have the same number of dimensions.
In addition:

  • for multi-dimensional arrays, both arrays must have the same size;
  • for single arrays with a single dimension, the array on the left side of the assignment operator must have a size that is equal or bigger than the one on the right side.
new destination[8];
new msg[] = "Hello World!";
 
destination = msg;

In the above code, we try to fit 12 characters in an array that can only support 8. By increasing the array size of the destination, we can solve this. Note that a string also requires a null terminator so the total length of «Hello World!» plus the null terminator is, in fact, 13.

new destination[13];
new msg[] = "Hello World!";
 
destination = msg;

055: start of function body without function header

This error usually indicates an erroneously placed semicolon at the end of the function header.

Common Fatal Errors

100: cannot read from file: «<file>»

The compiler cannot find, or read from, the specified file. Make sure that the file you are trying to include is in the proper directory (default: <server directory>pawnoinclude).

Tip

Image:Light_bulb_icon.png

Multiple copies of pawno can lead to this problem. If this is the case, don’t double click on a .pwn file to open it. Open your editor first, then open the file through the editor.

Common Warnings

202: number of arguments does not match definition

The description of this warning is pretty self-explanatory. You’ve passed either too few or too many parameters to a function. This is usually an indication that the function is used incorrectly. Refer to the documentation to figure out the correct usage of the function.

This usually happen on GetPlayerHealth function with PAWNO function auto completion as it confuses with the NPC GetPlayerHealth function that only has ‘playerid’ argument.

Example:

GetPlayerHealth(playerid);

Fixed:

new Float:health;
GetPlayerHealth(playerid, health);

203: symbol is never used: «symbol»

You have created a variable or a function, but you’re not using it. Delete the variable or function if you don’t intend to use it. This warning is relatively safe to ignore.

The stock keyword will prevent this warning from being shown, as variables/functions with the stock keyword are not compiled unless they are used.

stock SomeFunction()
{
    // Blah
}
 
// There will be no warning if this function is never used

204: symbol is assigned a value that is never used: «symbol»

Similar to the previous warning. You created a variable and assigned it a value, but you’re not using that value anywhere. Use the variable, or delete it. This warning, too, is relatively safe to ignore.

209: function should return a value

You have created a function without a return value

SomeFunction()
{
     // Blah
}

but you used it to assign on variable or function argument,

new result = SomeFunction(); // expected value = 1

Fixed:

SomeFunction()
{
     // Blah
     return 1;
}

211: possibly unintended assignment

The assignment operator (=) was found in an if-statement, instead of the equality operator (==). If the assignment is intended, the expression must be wrapped in parentheses. Example:

if(vehicle = GetPlayerVehicleID(playerid)) // warning
if(vehicle == GetPlayerVehicleID(playerid)) // no warning
if((vehicle = GetPlayerVehicleID(playerid))) // no warning; the value returned by the function will be assigned to the variable and the expression is then evaluated.

213: tag mismatch

A tag mismatch occurs when:

  • Assigning to a tagged variable a value that is untagged or that has a different tag
  • The expressions on either side of a binary operator have different tags
  • In a function call, passing an argument that is untagged or that has a different tag than what the function argument was defined with
  • Indexing an array which requires a tagged index with no tag or a wrong tag name

Usually happen on a new variable created with missing tag on the required function such as Float:, Text3D:, Text:, etc. Example,

Bad:

new health;
GetPlayerHealth(playerid, health);

Good:

new Float:health;
GetPlayerHealth(playerid, health);

217: loose indentation

The compiler will issue this warning if the code indentation is ‘loose’, example:

Good:

if(condition)
{
    action();
    result();
}

Bad:

if(condition)
{
    action();
  result();
}

Indentation means to push (indent) text along from the left of the page (by pressing the TAB key). This is common practice in programming to make code easier to read.
This warning also exists to avoid dangling-else problem.

219: local variable «foo» shadows a variable at a preceding level

A local variable, i.e. a variable that is created within a function or callback, cannot have the same name as a global variable, an enum specifier, a function, or a variable declared higher up in the same function. The compiler cannot tell which variable you’re trying to alter.

It is customary to prefix global variables with ‘g’ (e.g. gTeam). However, global variables should be avoided where possible.

new team[MAX_PLAYERS]; // variable declared in the global scape
 
function(playerid)
{
    new team[MAX_PLAYERS]; // declared in the local scope, shadows the variable in the global scope, warning 219
    team[playerid] = random(5); // which variable are we trying to update here?
}

225: unreachable code

The indicated code will never run, because an instruction before (above) it causes a jump out of the function, out of a loop or elsewhere. Look for return, break, continue and goto instructions above the indicated line. Unreachable code can also be caused by an endless loop above the indicated line.

Example:

CMD:jetpack(playerid, params[])
{
	#pragma unused params
	if(IsPlayerAdmin(playerid))
	{
	    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
	    return 1; // jumps out the command
	}
	else
	{
	    SendClientMessage(playerid, -1, "You are not admin!");
	    return 1; // jumps out the command
	}
	SendClientMessage(playerid, -1, "You typed command /jp"); // this code is not reachable and will not run.
}

Fixed:

CMD:jetpack(playerid, params[])
{
	#pragma unused params
	if(IsPlayerAdmin(playerid))
	{
	    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
	}
	else
	{
	    SendClientMessage(playerid, -1, "You are not admin!");
	}
	SendClientMessage(playerid, -1, "You typed command /jp"); // this code will run.
	return 1; // jumps out the command
}

235: public function lacks forward declaration (symbol «symbol»)

Your public function is missing a forward declaration.

Bad:

public MyFunction()
{
    // blah
}

Good:

forward MyFunction();
 
public MyFunction()
{
    // blah
}

External Links

  • pawn-lang.pdf

Ошибки и варнинги:

Код:

C:UsersAltDesktopserver hugopawnoincludesscanf2.inc(342) : warning 219: local variable "string" shadows a variable at a preceding level
C:UsersAltDesktopserver hugopawnoincludesscanf2.inc(402) : warning 219: local variable "string" shadows a variable at a preceding level
C:UsersAltDesktopserver hugogamemodesBorbaris.pwn(80) : warning 219: local variable "PlayerName" shadows a variable at a preceding level
C:UsersAltDesktopserver hugogamemodesBorbaris.pwn(151) : error 055: start of function body without function header
C:UsersAltDesktopserver hugogamemodesBorbaris.pwn(153) : error 021: symbol already defined: "GetPlayerName"
C:UsersAltDesktopserver hugogamemodesBorbaris.pwn(155) : error 010: invalid function or declaration
C:UsersAltDesktopserver hugogamemodesBorbaris.pwn(156) : error 010: invalid function or declaration
C:UsersAltDesktopserver hugogamemodesBorbaris.pwn(157) : error 010: invalid function or declaration
C:UsersAltDesktopserver hugogamemodesBorbaris.pwn(159) : error 010: invalid function or declaration
C:UsersAltDesktopserver hugogamemodesBorbaris.pwn(167) : error 010: invalid function or declaration
C:UsersAltDesktopserver hugogamemodesBorbaris.pwn(175) : error 010: invalid function or declaration
C:UsersAltDesktopserver hugogamemodesBorbaris.pwn(180) : error 010: invalid function or declaration
C:UsersAltDesktopserver hugogamemodesBorbaris.pwn(344) : warning 219: local variable "PlayerName" shadows a variable at a preceding level
C:UsersAltDesktopserver hugogamemodesBorbaris.pwn(366) : warning 219: local variable "PlayerName" shadows a variable at a preceding level
C:UsersAltDesktopserver hugogamemodesBorbaris.pwn(414) : warning 219: local variable "PlayerName" shadows a variable at a preceding level
C:UsersAltDesktopserver hugogamemodesBorbaris.pwn(427) : warning 203: symbol is never used: "PlayerName"
C:UsersAltDesktopserver hugogamemodesBorbaris.pwn(427) : warning 203: symbol is never used: "adminlvl"
C:UsersAltDesktopserver hugogamemodesBorbaris.pwn(427) : warning 203: symbol is never used: "adminname"
C:UsersAltDesktopserver hugogamemodesBorbaris.pwn(427) : warning 203: symbol is never used: "pleer"
C:UsersAltDesktopserver hugogamemodesBorbaris.pwn(427) : warning 203: symbol is never used: "string"
C:UsersAltDesktopserver hugogamemodesBorbaris.pwn(427) : warning 203: symbol is never used: "string2"

Код:
(места где ошибки и варнинги)

Код:

CMD:makeadmin(playerid,params[]);
{
   new PlayerName[MAX_PLAYER_NAME],adminlvl,pleer,adminname[128],string[128],string2[128];
   GetPlayerName(pleer,PlayerName,sizeof(PlayerName));
   GetPlayerName(playerid,adminname,sizeof(adminname));
   if(sscanf(params,"ud",pleer,adminlvl))
   return SendClientMessage(playerid,0xC9C9FF,"Используй /makeadmin [ID] [1-5]");
   if(Player[playerid][pAdmin] == 5 || IsPlayerAdmin(playerid))
   {
      if(adminlvl == 0)
      {
         Player[playerid][pAdmin] == adminlvl;
         format(string,sizeof(string),"Администратор %s вас с должности администратора",adminname);
         format(string2,sizeof(string2),"Вы сняли %s с должности администратора",PlayerName);
         SendClientMessage(pleer,COLOR_RED,string);
         SendClientMessage(playerid,COLOR_RED,string2);
      }
      if(adminlvl >= 1 && adminlvl <= 5)
      {
         Player[playerid][pAdmin] = adminlvl;
         format(string,sizeof(string),"Администратор %s назначил вас на должность администратора %d уровня",adminname,adminlvl);
         format(string2,sizeof(string2),"Вы назначили %s на должность администратора %d уровня",PlayerName,adminlvl);
         SendClientMessage(pleer,COLOR_RED,string);
         SendClientMessage(playerid,COLOR_RED,string2);
      }
      if(adminlvl > 6)
      {
         SendClientMessage(playerid,COLOR_RED,"Максимальный уровень --> 5");
      }
   }
   return 1;
}

Строчки где ошибки:

{

GetPlayerName(pleer,PlayerName,sizeof(PlayerName));

if(sscanf(params,"ud",pleer,adminlvl))

return SendClientMessage(playerid,0xC9C9FF,"Используй /makeadmin [ID] [1-5]");

if(Player[playerid][pAdmin] == 5 || IsPlayerAdmin(playerid))

if(adminlvl == 0)

if(adminlvl >= 1 && adminlvl <= 5)

if(adminlvl > 6)

return 1;

P.S. Извините меня, я только начинаю изучать этот язык и не способен исправлять свои ошибки, благодарю заранее за помощь!

#include &lt;a_samp&gt;
#include &lt;mxINI&gt;
forward OnPlayerRegister(playerid, password[]);
forward OnPlayerLogin(playerid,password[]);
enum pInfo
{
    pPass[64],
    pMoney
};
new PlayerInfo[MAX_PLAYERS][pInfo];
new PAccount[MAX_PLAYERS];
main()
{
	print("n----------------------------------");
	print("===============roleplay=============");
	print("----------------------------------n");
}


public OnGameModeInit()
{
	SetGameModeText("Blank Script");
	AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    	if(PAccount[playerid] == 1)
{
	    ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"{FFFFFF}Авторизация","{FFFC23}Добро пожаловать на сервер{11F1F1}Akula RolePlayn{11F1F1}Ваш аккаунт под ником %s зарегистрирован на нашем сервере!","{F1F234}Пожалуйсто введите пароль в окошко:nn","Авторизация");
}
	
		ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{FFFFFF}Регистрация","{FFFC23}Добро пожаловать на наш сервер{11F1F1}Akula RolePlayn{11F1F1}Ваш аккаунт под ником %s не зарегистрирован на нашем сервере!","{F1F234}Пожалуйсто введите свой пароль в окошко:nn","Регистрация");
}

{
public OnPlayerConnect(playerid)
{
    new playername[MAX_PLAYER_NAME];
	new string[128];
	GetPlayerName(playerid,playername,sizeof(playername));
	format(string,sizeof(string),"users/%s.ini", playername);
	if(fexist(string))
{
    PAccount[playerid] = 1;
}

	{
	}

}

public OnPlayerDisconnect(playerid, reason)
{
    SavePlayer(playerid);
	return 1;
}

public OnPlayerSpawn(playerid)
{
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/mycommand", cmdtext, true, 10) == 0)
	{
		return 1;
	}
	return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
	return 1;
}

public OnRconCommand(cmd[])
{
	return 1;
}

public OnPlayerRequestSpawn(playerid)
{
	return 1;
}

public OnObjectMoved(objectid)
{
	return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
	return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
	return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
	return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
	return 1;
}

public OnPlayerExitedMenu(playerid)
{
	return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
	return 1;
}

public OnPlayerUpdate(playerid)
{
	return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
	return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
	return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
	return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
	{
	    if(dialogid == 1)
	{
	    if(response)
	    {
	        if(!strlen(inputtext))
	        {
	            ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"{FFFFFF}Авторизация","{FFFC23}Добро пожаловать на сервер{11F1F1}Akula RolePlayn{11F1F1}Ваш аккаунт под ником %s зарегистрирован на нашем сервере!","{F1F234}Пожалуйсто введите пароль в окошко:nn","Авторизация");
	            return 1;
	        }
	        new pass[64];
	        strmid(pass,inputtext,0,strlen(inputtext),64);
	        OnPlayerLogin(playerid,pass);
	    }
	    else
	    {
	        ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"{FFFFFF}Авторизация","{FFFC23}Добро пожаловать на сервер{11F1F1}Akula RolePlayn{11F1F1}Ваш аккаунт под ником %s зарегистрирован на нашем сервере!","{F1F234}Пожалуйсто введите пароль в окошко:nn","Авторизация");
	    }
	}
		if(dialogid == 2)
	{
	    if(response)
	    {
	        if(!strlen(inputtext))
	        {
	            ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{FFFFFF}Регистрация","{FFFC23}Добро пожаловать на наш сервер{11F1F1}Akula RolePlayn{11F1F1}Ваш аккаунт под ником %s не зарегистрирован на нашем сервере!","{F1F234}Пожалуйсто введите свой пароль в окошко:nn","Регистрация");
	            return 1;
	        }
	        new pass[64];
	        strmid(pass,inputtext,0,strlen(inputtext),64);
	        OnPlayerRegister(playerid,pass);
	    }
	    else
	    {
	        ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{FFFFFF}Регистрация","{FFFC23}Добро пожаловать на наш сервер{11F1F1}Akula RolePlayn{11F1F1}Ваш аккаунт под ником %s не зарегистрирован на нашем сервере!","{F1F234}Пожалуйсто введите свой пароль в окошко:nn","Регистрация");
	    }
	}
		return 1;
	}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	return 1;
}
public OnPlayerRegister(playerid, password[])
{
    if(IsPlayerConnected(playerid))
    {
        new string[64];
        new playername[MAX_PLAYER_NAME];
        GetPlayerName(playerid, playername, sizeof(playername));
        format(string,sizeof(string), "users/%s.ini", playername);
        new iniFile = ini_createFile(string);
        if(iniFile &lt; 0)
        {
            iniFile = ini_openFile(string);
        }
        if(iniFile &gt;= 0)
        {
            strmid(PlayerInfo[playerid][pPass],password,0,strlen(password),255);
            ini_setString(iniFile,"Pass",PlayerInfo[playerid][pPass]);
            ini_closeFile(iniFile);
            ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"{FFFFFF}Авторизация","{FFFC23}Добро пожаловать на сервер{11F1F1}Akula RolePlayn{11F1F1}Ваш аккаунт под ником %s зарегистрирован на нашем сервере!","{F1F234}Пожалуйсто введите пароль в окошко:nn","Авторизация");
        }
    }
    return 1;
}
stock SavePlayer(playerid)
{
    new string[64];
    new playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername, sizeof(playername));
    format(string, sizeof(string), "users/%s.ini", playername);
    new iniFile = ini_openFile(string);
    ini_setString(iniFile,"Pass",PlayerInfo[playerid][pPass]);
    ini_closeFile(iniFile);
}
public OnPlayerLogin(playerid,password[])
{
    if(IsPlayerConnected(playerid))
    {
        new string[64];
        new pass[64];
        new playername[MAX_PLAYER_NAME];
        GetPlayerName(playerid, playername, sizeof(playername));
        format(string,sizeof(string), "users/%s.ini", playername);
        new iniFile = ini_openFile(string);
        ini_getString(iniFile,"Pass",pass,64);
        if(strcmp(pass,password,true) == 0)
        {
            ini_getString(iniFile,"Pass",PlayerInfo[playerid][pPass],64);
            ini_closeFile(iniFile);
        }
        else
        {
            ini_closeFile(iniFile);
            ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"{FFFFFF}Авторизация","{FFFC23}Добро пожаловать на сервер{11F1F1}Akula RolePlayn{11F1F1}Ваш аккаунт под ником %s зарегистрирован на нашем сервере!","{F1F234}Пожалуйсто введите пароль в окошко:nn","Авторизация");
            return 1;
        }
        SendClientMessage(playerid,0xFF00000,"Вы вошли на наш сервер Akula Role Play");
        SpawnPlayer(playerid);
    }
    return 1;
}

Содержание

  1. Pawno что такое 1 error
  2. Errors List
  3. From SA-MP Wiki
  4. Contents
  5. General Pawn Error List
  6. Error categories
  7. Errors
  8. Fatal errors
  9. Warnings
  10. Common Errors
  11. 001: expected token
  12. 002: only a single statement (or expression) can follow each “case”
  13. 004: function «x» is not implemented
  14. 025: function heading differs from prototype
  15. 035: argument type mismatch (argument x)
  16. 036: empty statement
  17. 046: unknown array size (variable x)
  18. 047: array sizes do not match, or destination array is too small
  19. 055: start of function body without function header
  20. Common Fatal Errors
  21. 100: cannot read from file: » «
  22. Common Warnings
  23. 202: number of arguments does not match definition
  24. 203: symbol is never used: «symbol»
  25. 204: symbol is assigned a value that is never used: «symbol»
  26. 209: function should return a value
  27. 211: possibly unintended assignment
  28. 213: tag mismatch
  29. 217: loose indentation
  30. 219: local variable «foo» shadows a variable at a preceding level
  31. 225: unreachable code
  32. 235: public function lacks forward declaration (symbol «symbol»)

Pawno что такое 1 error

    Команда форума Сообщений: 3 021
    Регистрация: 14.07.2017
  • IP: 127.0.0.1:8904
  • Занятия: Скриптер

Из названия все ясно. ИД’ы всех ошибок, фатальных ошибок, а также предупреждений в PAWNO.

error 001: expected token: «%s», but found «%s» — пропущен символ «%s», но найден «%s»;

error 002: only a single statement (or expression) can follow each «case» — Только один оператор и и выражение может следовать после «case»;

error 003: declaration of a local variable must appear in a compound block — Локальные переменные должны быть в блоке;

error 004: function «%s» is not implemented — функция «%s» не определена;

error 005: function may not have arguments — Функция может не иметь аргументов;

error 006: must be assigned to an array — Это должно быть в массиве;

error 007: operator cannot be redefined — Оператор не может использоваться;

error 008: must be a constant expression; assumed zero — Это должно быть константой равной нулю;

error 009: invalid array size (negative or zero) — Неправильный размер массива. Отрицательное значение или ноль;

error 010: invalid function or declaration — Неправильная функция;

error 011: invalid outside functions — Неправильный вывод функции;

error 012: invalid function call, not a valid address — Неправильный вызов функции;

error 013: no entry point (no public functions) — Не точка входа;

error 014: invalid statement; not in switch — Неверная команда;

error 015: «default» case must be the last case in switch statement — Оператор «default» должен быть последним;

error 016: multiple defaults in «switch» — Несколько операторов «default» в «switch»;

error 017: undefined symbol «%s» — неизвестный символ (неопределённая переменная) «%s»;

error 018: initialization data exceeds declared size — несовпадение данных в массиве с указанными рамками (увеличить размер массива);

error 019: not a label: %s» — %s — не строка;

error 020: invalid symbol name «%s» — ошибочное название символа (начинается с цифры, например);

error 021: symbol already defined: %s» — символ уже определён (дважды встречается new одного и того-же символа);

error 022: must be lvalue (non-constant) — Должна быть левой частью;

error 023: array assignment must be simple assignment — начения массива должны быть простыми;

error 024: «break» or «continue» is out of context — Операторы «break» или «continue» вне границ блока;

error 025: function heading differs from prototype — Функция заголовка отличается от прототипа;

error 026: no matching «#if. » — «#if. » — не найдено;

error 027: invalid character constant — Неправильные символы константы;

error 028: invalid subscript (not an array or too many subscripts): %s» — неверное выражение, нет результата %s является недействительным массивом;

error 029: invalid expression, assumed zero — неверное выражение, нет результата;

error 030: compound statement not closed at the end of file — составной оператор не закрыт в конце файла, поставить return 1;> в конец мода;

error 031: unknown directive — неверная директива (подключение плагина в дефайнах, неверное установка пути инклуда и тому подобное);

error 032: array index out of bounds (variable «%s») — Индекс массива превышен;

error 033: array must be indexed (variable «%s») — Массив неизвестен;

error 034: argument does not have a default value (argument %d) — Аргумент не имеет начального значения;

error 035: argument type mismatch (argument %d) — Несоответствие типов аргумента;

error 036: empty statement — Пустой оператор;

error 037: invalid string (possibly non-terminated string) — незавершённая строка (обычно бывает, если забывам ставить закрывающие ковычки);

error 038: extra characters on line — Лишние символы в строке;

error 039: constant symbol has no size — Символьная константа не имеет размера;

error 040: duplicate «case» label (value %d) — несколько раз объявлен «case» с одним и тем же параметром;

error 041: invalid ellipsis, array size is not known — Размер массива неизвестно;

error 042: invalid combination of class specifiers — Недопустимое сочетание класса;

error 043: character constant exceeds range for packed string — Символьная константа превышает размер строки;

error 044: positional parameters must precede all named parameters — ;

error 045: too many function arguments — Слишком много аргументов для функции;

error 046: unknown array size (variable «%s») — Неизвестный размер массива %s;

error 047: array sizes do not match, or destination array is too small — размеры массивов конфликтуют, либо целевой массив слишком маленький (нужно увеличить число в квадратных скобках);

error 048: array dimensions do not match — Размеры массива не совпадают;

error 049: invalid line continuation — Неправильное продолжении линии;

error 050: invalid range — Неправильный диапазон;

error 051: invalid subscript, use «[ ]» operators on major dimensions — Неправильный индекс. Используйте «[ ]»;

error 052: multi-dimensional arrays must be fully initialized — Много размерные массивы должны быть

error 053: exceeding maximum number of dimensions — Превышение максимального числа измерений;

error 054: unmatched closing brace — Непревзойденная закрывающаяся скобка;

error 055: start of function body without function header — описание функции без заголовка (пропущен public(. ));

error 056: arrays, local variables and function arguments cannot be public (variable «%s») — ;

error 057: unfinished expression before compiler directive — Незавершенное выражение для компилятора;

error 058: duplicate argument; same argument is passed twice — Дублирование аргумента. Аргумент передается несколько раз;

error 059: function argument may not have a default value (variable «%s») — Аргумент не может иметь значение по-умолчанию;

error 060: multiple «#else» directives between «#if . #endif» — Несколько «#else» между «#if . #endif»;

error 061: «#elseif» directive follows an «#else» directive — «#elseif» перед «#else»;

error 062: number of operands does not fit the operator — Количество операторов не соответствует оператору;

error 063: function result tag of operator «%s» must be «%s» — Результат функции %s должен быть %s;

error 064: cannot change predefined operators — Невозможно изменить уже определенные операторы;

error 065: function argument may only have a single tag (argument %d) — В этой функции может быть только один аргумент %d;

error 066: function argument may not be a reference argument or an array (argument «%s») — Аргумент функции не может быть ссылкой или массивом;

error 067: variable cannot be both a reference and an array (variable «%s») — Переменная %s не может быть как массив или ссылка;

error 068: invalid rational number precision in #pragma — Неправильное число в #pragma;

error 069: rational number format already defined — Формат рационального числа уже определен;

error 070: rational number support was not enabled — Рациональное число не поддерживается;

error 071: user-defined operator must be declared before use (function «%s») — Объявленный оператор должен быть перед использованием;

error 072: «sizeof» operator is invalid on «function» symbols — Оператор «sizeof» не может быть использован для символов;

error 073: function argument must be an array (argument «%s») — Аргумент %s должен быть массивом;

error 074: #define %s must start with an alphabetic character — макрос %s должен начинаться с букв;

error 075: input line too long (after substitutions) — слишком длинная строка после интеграции параметров (возможно, много лишних пробелов, или результативные данные слишком велики для строки (по длине));

error 076: syntax error in the expression, or invalid function call — Неправильный синтаксис или неправильный вызов функции;

error 077: malformed UTF-8 encoding, or corrupted file: %s — Плохая кодировка UTF-8 или плохой файл %s;

error 078: function uses both «return» and «return » — Функция использует два «return»;

error 080: unknown symbol, or not a constant symbol (symbol «%s») — Неизвестный или непостоянный символ %s;

error 081: cannot take a tag as a default value for an indexed array parameter (symbol «%s») — Нельзя взять значение в массив %s;

error 082: user-defined operators and native functions may not have states — нативы и пользовательские операторы не могут иметь переключателей;

error 083: a function may only belong to a single automaton (symbol «%s») — Функция может принадлежать только к одной автоматизации;

error 084: state conflict: one of the states is already assigned to another implementation (symbol «%s») — для функции %s уже определенна данная state;

error 085: no states are defined for function «%s» — не определенна ни одна state для функции %s;

error 086: unknown automaton «%s» — Неизвестная автоматизация %s;

error 087: unknown state «%s» for automaton «%s» — не определен state %s, для переключения %s;

error 088: number of arguments does not match definition — количество аргументов не совпадает с объявленными в функции;

fatal error 100: cannot read from file: «%s» — невозможно прочитать/найти файл %s в стандартной директории;

fatal error 107: too many error messages on one line — слишком много ошибок на одной строке (обычно из-за одного неправильного параметра);

warning 200: symbol «%s» is truncated to 31 characters — название переменной %s обрезается до 31 символа (укоротите название переменной %s);

warning 201: redefinition of constant/macro (symbol «%s») — двойное определение одинаковой константы (смотреть #define);

warning 202: number of arguments does not match definition — несовпадение количества аргументов;

warning 203: symbol is never used: «%» — символ «%» нигде не используется;

warning 204: symbol is assigned a value that is never used: «%s» — символ создан, ему присваивается значение, но далее он не используется.

warning 208: function with tag result used before definition, forcing reparse — функция с типовым результатом используется перед объявлением

warning 209: function «%s» should return a value — функция %s должна возвращать какое-либо значение (return 1; к примеру);

warning 211: possibly unintended assignment — в условии использовано не сравнение, а присвоение;

warning 213: tag mismatch — несовпадение тэгов;

warning 215: expression has no effect — выражение не имеет эффекта;

warning 216: nested comment — вложенный комментарий (вынесите его за функцию);

warning 217: loose indentation — невыровненная строка (return должен быть строго под телом функции по левому краю, либо можно добавить в начало мода строку #pragma tabsize 0, но это не рекомендуется, так как иногда может не понимать и не прочитывать скобки «<» и «>«);

warning 219: local variable «%s» shadows a variable at a preceding level — переменная дважды объявлена;

warning 224: indeterminate array size in «sizeof» expression (symbol «%s») — должен быть определён размер массива %s (если определён статиком, заменить дефайном);

warning 225: unreachable code — невалидный код;

warning 235: public function lacks forward declaration (symbol «%s») — необходим форвард функции %s (перед функцией пишем forward %s;

Пояснение: «%s — имя переменной/макроса/аргумента функции».

Авторы: OKStyle, webserfer, Kaza40k, [Nos]B[R]aiN[L], Ym[0]n, _volk_, ДениСыч, Roman1us.

При копировании на другие ресурсы, обязательно указывайте авторов, не зря ведь люди старались

Отредактировано 27 июля, 2017 пользователем stibs
Причина: bb код

Источник

Errors List

From SA-MP Wiki

Contents

General Pawn Error List

This pages contains the most common errors and warnings produced by the pawn compiler when creating SA:MP scripts.

When the compiler finds an error in a file, it outputs a message giving, in this order:

  • the name of the file
  • the line number were the compiler detected the error between parentheses, directly behind the filename
  • the error class (error, fatal error or warning)
  • an error number
  • a descriptive error message

Note: The error may be on the line ABOVE the line that is shown, since the compiler cannot always establish an error before having analyzed the complete expression.

Error categories

Errors are separated into three classes:

Errors

  • Describe situations where the compiler is unable to generate appropriate code.
  • Errors messages are numbered from 1 to 99.

Fatal errors

  • Fatal errors describe errors from which the compiler cannot recover.
  • Parsing is aborted.
  • Fatal error messages are numbered from 100 to 199.

Warnings

  • Warnings are displayed for unintended compiler assumptions and common mistakes.
  • Warning messages are numbered from 200 to 299.

Common Errors

001: expected token

A required token is missing.

002: only a single statement (or expression) can follow each “case”

Every case in a switch statement can hold exactly one statement.
To put multiple statements in a case, enclose these statements
between braces (which creates a compound statement).

The above code also produces other warnings/errors:

004: function «x» is not implemented

Most often caused by a missing brace in the function above.

025: function heading differs from prototype

This usually happen when new sa-mp version comes with new addition of argument to a function, like OnPlayerGiveDamage from 0.3x to 0.3z. The scripter must add «bodypart» argument to OnPlayerGiveDamage callback on their script.

Caused by either the number of arguments or the argument name is different.

035: argument type mismatch (argument x)

An argument passed to a function is of the wrong ‘type’. For example, passing a string where you should be passing an integer.

036: empty statement

Caused by a rogue semicolon ( ; ), usually inadvertently placed behind an if-statement.

046: unknown array size (variable x)

For array assignment, the size of both arrays must be explicitly defined, also if they are passed as function arguments.

047: array sizes do not match, or destination array is too small

For array assignment, the arrays on the left and the right side of the assignment operator must have the same number of dimensions. In addition:

  • for multi-dimensional arrays, both arrays must have the same size;
  • for single arrays with a single dimension, the array on the left side of the assignment operator must have a size that is equal or bigger than the one on the right side.

In the above code, we try to fit 12 characters in an array that can only support 8. By increasing the array size of the destination, we can solve this. Note that a string also requires a null terminator so the total length of «Hello World!» plus the null terminator is, in fact, 13.

055: start of function body without function header

This error usually indicates an erroneously placed semicolon at the end of the function header.

Common Fatal Errors

100: cannot read from file: » «

The compiler cannot find, or read from, the specified file. Make sure that the file you are trying to include is in the proper directory (default: pawnoinclude).

Multiple copies of pawno can lead to this problem. If this is the case, don’t double click on a .pwn file to open it. Open your editor first, then open the file through the editor.

Common Warnings

202: number of arguments does not match definition

The description of this warning is pretty self-explanatory. You’ve passed either too few or too many parameters to a function. This is usually an indication that the function is used incorrectly. Refer to the documentation to figure out the correct usage of the function.

This usually happen on GetPlayerHealth function with PAWNO function auto completion as it confuses with the NPC GetPlayerHealth function that only has ‘playerid’ argument.

203: symbol is never used: «symbol»

You have created a variable or a function, but you’re not using it. Delete the variable or function if you don’t intend to use it. This warning is relatively safe to ignore.

The stock keyword will prevent this warning from being shown, as variables/functions with the stock keyword are not compiled unless they are used.

204: symbol is assigned a value that is never used: «symbol»

Similar to the previous warning. You created a variable and assigned it a value, but you’re not using that value anywhere. Use the variable, or delete it. This warning, too, is relatively safe to ignore.

209: function should return a value

You have created a function without a return value

but you used it to assign on variable or function argument,

211: possibly unintended assignment

The assignment operator (=) was found in an if-statement, instead of the equality operator (==). If the assignment is intended, the expression must be wrapped in parentheses. Example:

213: tag mismatch

A tag mismatch occurs when:

  • Assigning to a tagged variable a value that is untagged or that has a different tag
  • The expressions on either side of a binary operator have different tags
  • In a function call, passing an argument that is untagged or that has a different tag than what the function argument was defined with
  • Indexing an array which requires a tagged index with no tag or a wrong tag name

Usually happen on a new variable created with missing tag on the required function such as Float:, Text3D:, Text:, etc. Example,

217: loose indentation

The compiler will issue this warning if the code indentation is ‘loose’, example:

Indentation means to push (indent) text along from the left of the page (by pressing the TAB key). This is common practice in programming to make code easier to read. This warning also exists to avoid dangling-else problem.

219: local variable «foo» shadows a variable at a preceding level

A local variable, i.e. a variable that is created within a function or callback, cannot have the same name as a global variable, an enum specifier, a function, or a variable declared higher up in the same function. The compiler cannot tell which variable you’re trying to alter.

It is customary to prefix global variables with ‘g’ (e.g. gTeam). However, global variables should be avoided where possible.

225: unreachable code

The indicated code will never run, because an instruction before (above) it causes a jump out of the function, out of a loop or elsewhere. Look for return, break, continue and goto instructions above the indicated line. Unreachable code can also be caused by an endless loop above the indicated line.

235: public function lacks forward declaration (symbol «symbol»)

Your public function is missing a forward declaration.

Источник

#1

Отправлено 20 Январь 2020 — 16:30

Всем привет, у меня тут завалялся один плагин, он даёт цвет игроку в зависимости от определённого количества очков!

Я его декомпилировала через: lysis.exe.
Но только там очень много ошибок!

Прикрепленные файлы

Сообщение отредактировал Medusa: 25 Январь 2020 — 22:40

  • Lesdure это нравится
  • Наверх

#2


AlexMy

Отправлено 20 Январь 2020 — 18:30

Всем привет, у меня тут завалялся один плагин, он даёт цвет игроку в зависимости от определённого количества очков!

Я его декомпилировала через: lysis.exe, вообщем если кого заинтересует вот исходник.
Но только там очень много ошибок!

А вообще должно получиться так!

После декомпилятора ловить уже нечего, компилятор добавляет свои части коды. 

  • Наверх

#3


Medusa

Отправлено 20 Январь 2020 — 18:35

После декомпилятора ловить уже нечего, компилятор добавляет свои части коды. 

Тоесть сделать его рабочим вообще никак?

  • Наверх

#4


AlexMy

Отправлено 20 Январь 2020 — 18:47

Тоесть сделать его рабочим вообще никак?

Ну почему же, это в прицепи реально. Но народ молвит что проще новый код написать, чем восстанавливать после декомпилятора. Судя по весу файла он очень большой, не думаю что есть такие смельчаки тут.  

  • Наверх

#5


dragokas

Отправлено 25 Январь 2020 — 17:18

Скинь готовый плагин, посмотрю.

Я его декомпилировала через: lysis.exe.

Онлайновый знаю, а вот чтобы под винду (lysis.exe), такого не видел.

  • Наверх

#6


Medusa

Отправлено 25 Январь 2020 — 22:37

Скинь готовый плагин, посмотрю.

Онлайновый знаю, а вот чтобы под винду (lysis.exe), такого не видел.

Прикрепленные файлы

Сообщение отредактировал Medusa: 25 Январь 2020 — 23:23

  • dragokas это нравится
  • Наверх

#7


dragokas

Отправлено 26 Январь 2020 — 1:26

Не знаю, откуда взяли, но спасибо. Ещё пригодиться, когда онлайновая версия недоступна.

На счёт статистики:

public Plugin:myinfo =

{

    name = «Custom Player Stats»,

    description = «Player Stats and Ranking for Left 4 Dead and Left 4 Dead 2.»,

    author = «Mikko Andersson (muukis)»,

    version = «1.4B117»,

};

Автор известен и его плагин доступен на AM.

Или это некая подправленная версия?

Сообщение отредактировал dragokas: 26 Январь 2020 — 1:27

  • Наверх

#8


Medusa

Отправлено 26 Январь 2020 — 11:12

Это подправленная версия, вот только уже сама не помню откуда его взяла.
У меня есть где-то уже готовый плагин этого исходника, вот только никак не могу найти. Готовый плагин даже не проверяла, времени особо не было.

Не знаю, откуда взяли, но спасибо. Ещё пригодиться, когда онлайновая версия недоступна.

На счёт статистики:

Автор известен и его плагин доступен на AM.

Или это некая подправленная версия?

Сообщение отредактировал Medusa: 26 Январь 2020 — 11:14

  • Наверх

#9


dragokas

Отправлено 26 Январь 2020 — 13:02

Если она правленная кем-то другим, и нет в открытом доступе на AM, то я обычно делаю так:

 — декомпилирую правленный smx, смотрю в заголовке, какой версией компилятора он был собран, качаю оффлайновый компилятор именно этой версии (или если он ну ооочень старый и его snapshot не доступен уже, то самую минимально доступную версию)

 — качаю все доступные исходники этого плагина из AM и собираю их той же версией компилятора

 — затем декомпилирую собранный мною же smx

 — сравниваю 2 декомпилированных между собой, например, я предпочитаю для этого программу Beyond Compare (платная), или WinMerge (бесплатна).

Сравнение оной из декомпилированных этим способом пар даст максимально близкую схожесть, по которой уже можно без особых трудностей воспроизвести чужие правки.

P.S. Только декомпилятор лучше юзать не тот что у вас (а то он 2011 года), а обновлённый онлайновый.

Ну а если у вас на компе уже где-то завалялся исходник, то достаточно ввести ключевые слова, например, в Total Commander (ALT + F7), маска поиска *.sp и искомый текст SetEntityRenderColor

Скопировать всё найденное в другое место, искать в уже найденном по ключевому слову — имя автора muukis (или в обратном порядке)

Сообщение отредактировал dragokas: 26 Январь 2020 — 13:17

  • Наверх

#10


Medusa

Отправлено 26 Январь 2020 — 20:36

Декомпелировала его онлайновым. Отличие есть, ещё и не маленькие, особенно размером файла. Да и внутри много чего изменилось. Вообщем вот, посмотришь)
Я использую: Notepad++

Если она правленная кем-то другим, и нет в открытом доступе на AM, то я обычно делаю так:

 — декомпилирую правленный smx, смотрю в заголовке, какой версией компилятора он был собран, качаю оффлайновый компилятор именно этой версии (или если он ну ооочень старый и его snapshot не доступен уже, то самую минимально доступную версию)

 — качаю все доступные исходники этого плагина из AM и собираю их той же версией компилятора

 — затем декомпилирую собранный мною же smx

 — сравниваю 2 декомпилированных между собой, например, я предпочитаю для этого программу Beyond Compare (платная), или WinMerge (бесплатна).

Сравнение оной из декомпилированных этим способом пар даст максимально близкую схожесть, по которой уже можно без особых трудностей воспроизвести чужие правки.

P.S. Только декомпилятор лучше юзать не тот что у вас (а то он 2011 года), а обновлённый онлайновый.

Ну а если у вас на компе уже где-то завалялся исходник, то достаточно ввести ключевые слова, например, в Total Commander (ALT + F7), маска поиска *.sp и искомый текст SetEntityRenderColor

Скопировать всё найденное в другое место, искать в уже найденном по ключевому слову — имя автора muukis (или в обратном порядке)

Сообщение отредактировал Medusa: 26 Январь 2020 — 20:41

  • Наверх

#11


Niko_ilshat

Niko_ilshat

    Новичок

  • Пользователь
  • Pip

  • 2 сообщений

Отправлено 18 Июнь 2020 — 20:16

У меня этот исходник не получается скомпилировать, есть целый плагин?

Декомпелировала его онлайновым. Отличие есть, ещё и не маленькие, особенно размером файла. Да и внутри много чего изменилось. Вообщем вот, посмотришь)
Я использую: Notepad++

  • Наверх

#12


Medusa

Отправлено 18 Июнь 2020 — 21:37

У меня этот исходник не получается скомпилировать, есть целый плагин?

Где-то должен быть, но никак найти не могу.
Недавно Windows переустанавливали
Нашла в интернете вот такую версию, исходник компилируется и в нем уже прописаны цвета за 1 — 2 — 3 места.
там нужен include — <glow>
Вот только не знаю поддерживает ли он первую часть лефты!
В нем написано что вроде только L4D2 поддерживает цвета.
Хоть точно не знаю, вообщем посмотрите потом напишите.
При компиляции пишет вот такие варнинги:

 

Прикрепленные файлы

  • Прикрепленный файл
     l4d_stats.sp   347,56К
      12 Количество загрузок:

Сообщение отредактировал Medusa: 18 Июнь 2020 — 21:49

  • Наверх

#13


A5774

A5774

    Новичок

  • Пользователь
  • Pip

  • 2 сообщений

Отправлено 21 Июнь 2020 — 0:46

void SetGlow(int client)
{
	if (IsFakeClient(client) || !StatsOn[client] || !GetClientTeam(2) || CurrentGamemodeID == 2)
		return;

	if (IsPlayerAlive(client) && cvar_Glow.IntValue)
	{
		SetEntProp(client, Prop_Send, "m_nGlowRange", 0);
		SetEntProp(client, Prop_Send, "m_nGlowRangeMin", 0);
		SetEntProp(client, Prop_Send, "m_iGlowType", 3);
			
		switch (ClientRank[client])
		{			
			case 1:
			{
				SetEntProp(client, Prop_Send, "m_glowColorOverride", GetColor(l4d2_Color_Rank1)); 
				SetEntityRenderColor(client, 153, 101, 21, 255);
				//L4D2_SetEntGlow(client, L4D2Glow_Constant, 0, 0, {255,215,0}, false);
			}
			case 2:
			{
				SetEntProp(client, Prop_Send, "m_glowColorOverride", GetColor(l4d2_Color_Rank2));
				SetEntityRenderColor(client, 128, 0, 128, 255);
				//L4D2_SetEntGlow(client, L4D2Glow_Constant, 0, 0, {139,0,139}, false);

			}
			case 3:
			{
				SetEntProp(client, Prop_Send, "m_glowColorOverride", GetColor(l4d2_Color_Rank3));
				SetEntityRenderColor(client, 0, 0, 255, 255);
				//L4D2_SetEntGlow(client, L4D2Glow_Constant, 0, 0, {0,206,209}, false); 
			}
			default:
			{
				SetEntityRenderColor(client, 255, 255, 255, 255);
				L4D2_SetEntGlow(client, L4D2Glow_None, 0, 0, {255,255,255}, false);
			}
		}
	}
}

Где-то должен быть, но никак найти не могу.
Недавно Windows переустанавливали
Нашла в интернете вот такую версию, исходник компилируется и в нем уже прописаны цвета за 1 — 2 — 3 места.
там нужен include — <glow>
Вот только не знаю поддерживает ли он первую часть лефты!
В нем написано что вроде только L4D2 поддерживает цвета.
Хоть точно не знаю, вообщем посмотрите потом напишите.
При компиляции пишет вот такие варнинги:

 

Ты про это?

А можно его как то в HLstatsX:CE засунуть?

Сообщение отредактировал A5774: 21 Июнь 2020 — 0:47

  • Наверх

#14


Medusa

Отправлено 21 Июнь 2020 — 10:00

void SetGlow(int client)
{
	if (IsFakeClient(client) || !StatsOn[client] || !GetClientTeam(2) || CurrentGamemodeID == 2)
		return;

	if (IsPlayerAlive(client) && cvar_Glow.IntValue)
	{
		SetEntProp(client, Prop_Send, "m_nGlowRange", 0);
		SetEntProp(client, Prop_Send, "m_nGlowRangeMin", 0);
		SetEntProp(client, Prop_Send, "m_iGlowType", 3);
			
		switch (ClientRank[client])
		{			
			case 1:
			{
				SetEntProp(client, Prop_Send, "m_glowColorOverride", GetColor(l4d2_Color_Rank1)); 
				SetEntityRenderColor(client, 153, 101, 21, 255);
				//L4D2_SetEntGlow(client, L4D2Glow_Constant, 0, 0, {255,215,0}, false);
			}
			case 2:
			{
				SetEntProp(client, Prop_Send, "m_glowColorOverride", GetColor(l4d2_Color_Rank2));
				SetEntityRenderColor(client, 128, 0, 128, 255);
				//L4D2_SetEntGlow(client, L4D2Glow_Constant, 0, 0, {139,0,139}, false);

			}
			case 3:
			{
				SetEntProp(client, Prop_Send, "m_glowColorOverride", GetColor(l4d2_Color_Rank3));
				SetEntityRenderColor(client, 0, 0, 255, 255);
				//L4D2_SetEntGlow(client, L4D2Glow_Constant, 0, 0, {0,206,209}, false); 
			}
			default:
			{
				SetEntityRenderColor(client, 255, 255, 255, 255);
				L4D2_SetEntGlow(client, L4D2Glow_None, 0, 0, {255,255,255}, false);
			}
		}
	}
}

Ты про это?

А можно его как то в HLstatsX:CE засунуть?

Да, вот как засунуть его в HLstatsX:CE не знаю

Сообщение отредактировал Medusa: 21 Июнь 2020 — 10:01

  • Наверх

#15


DenMarko

DenMarko

    Новичок

  • Пользователь
  • Pip

  • 35 сообщений

Отправлено 11 Июль 2020 — 23:23

Всем привет, у меня тут завалялся один плагин, он даёт цвет игроку в зависимости от определённого количества очков!

Я его декомпилировала через: lysis.exe.
Но только там очень много ошибок!

вот он https://forums.allie…&postcount=1960

а чтобы зделать для HLstatsX:CE нужно подключатся к его базе даных

  • Наверх

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Error 052 как исправить
  • Error 052 multi dimensional arrays must be fully initialized pawn
  • Error 050 network login failed
  • Error 050 invalid range
  • Error 05 canon фотоаппарат

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии