MAX_PlAYERS_NAME. New
#1

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

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.
Reply
#3

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
Reply
#4

Thanks all
Reply
#5

by default MAX_PLAYER_NAME is 24
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)