SA-MP Forums Archive
MAX_PlAYERS_NAME. New - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MAX_PlAYERS_NAME. New (/showthread.php?tid=646520)



MAX_PlAYERS_NAME. New - Osamakurdi - 18.12.2017

What is Max players name and when do i use it?
What is new and when do i use it?
Thanks any way


Re: MAX_PlAYERS_NAME. New - jasperschellekens - 18.12.2017

Max players name is usually used as max length of characters..
#define MAX_PLAYERS_NAME 20 will only allow 20 characters max i think.
Also you can use it like this:
#define MAX_PLAYER_VEHICLES 10 means that a player can not own more then 10 vehicles.
Код:
if(GetPlayerVehicles(playerid) >= MAX_PLAYER_VEHICLES)
			{
				ShowErrorDialog(playerid, "You can't buy any more vehicles! Max: " #MAX_PLAYER_VEHICLES );
				return 1;
			}
With new for example new Loggedin; you define a variable or create it a playervariable etc. I suggest you reading a pawn tutorial.


Re: MAX_PlAYERS_NAME. New - Konstantinos - 18.12.2017

A string (array) should have a constant size to store any data (text). A player's name can be up to 24 characters and so is defined. However, you will receive an error for rejected nickname if length exceeds 20 characters upon joining a server. So if you wanted to re-define it, you'd need to bare in mind the NULL terminator.
pawn Код:
#undef MAX_PLAYER_NAME
#define MAX_PLAYER_NAME 21
new declared a new variable. For more: https://sampwiki.blast.hk/wiki/Scripting_Basics


Re: MAX_PlAYERS_NAME. New - Osamakurdi - 31.12.2017

Thanks all


Re: MAX_PlAYERS_NAME. New - rfr - 31.12.2017

by default MAX_PLAYER_NAME is 24