Why people using variables like that?
#1

Hey, I want to ask you what are the differences between:
PHP код:
new string[128];
new 
string[128] = {false,...}
new 
Player[MAX_PLAYERS];
new 
Player[MAX_PLAYERS] = {INVALID_PLAYER_ID,...} 
Reply
#2

here is 1 example of [MAX_PLAYERS]

pawn Код:
new InDM[MAX_PLAYERS];


CMD:dm1(playerid,Params[])
{
         if(InDM[playerid] == 1) return SendClientMessage(playerid,COLOR_RED,"You are already in DM."); //to check if player is already in that dm or not
         SetPlayerPos(playerid, 1541.4945,-1342.2010,329.4573);
         SendClientMessage(playerid,COLOR_RED,"Star tower DM");
         GetPlayerWeapon(playerid);
         GivePlayerWeapon(playerid,24,1000);
         GivePlayerWeapon(playerid,25,1000);
         SetPlayerArmour(playerid, 100);
         InDM[playerid] = 1; //this will tell that player is now in dm.
         return 1;
 }
by using InDm we can also create leave dm command.. i hope it helped you a bit.
Reply
#3

pawn Код:
new array[3]; // <- In PAWN those are not initialized yet, so it keeps them zero

new array[3] = {1, 2, 3} // <- Initializes array with 1, 2, and 3

new array[3] = {3, ...} // <- Initializes the whole array with the value 3
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)