SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 09/04/2019, 12:43 PM   #4121
Nero_3D
High-roller
 
Nero_3D's Avatar
 
Join Date: Jun 2007
Location: Germany
Posts: 2,812
Reputation: 649
Default Re: Little coding questions - For general minor queries 5

Quote:
Originally Posted by Ermanhaut View Post
Reading a few topics about optimization i've found 'Char-arrays':
pawn Code:
new playerName[MAX_PLAYERS char][MAX_PLAYER_NAME];
GetPlayerName(playerid, playerName{playerid}, MAX_PLAYER_NAME);
printf("%s", playerName{playerid});

The code above would be right according to this topic but pawn-lang compiler rejects it.

Is there any mistakes in my code or is there something else i have to do to use Char-arrays?
An char array only works on the "major dimension" aka the last one because all other dimension before the last one are used for indexing and don't hold any data which could be converted to chars
Nero_3D is offline   Reply With Quote
Old 12/04/2019, 06:04 PM   #4122
v4yne1
Little Clucker
 
Join Date: Feb 2019
Posts: 26
Reputation: 4
Default Re: Little coding questions - For general minor queries 5

i want to make a tower climbing minigame. i thought about using virtual worlds for each player so every player has its own tower to climb on (to prevent crowd). i wonder if using 20 virtual worlds at once will cause any lag on my server? thanks in advance
v4yne1 is offline   Reply With Quote
Old 02/05/2019, 05:20 AM   #4123
Kwarde
High-roller
 
Join Date: Nov 2009
Location: The Netherlands
Posts: 2,201
Reputation: 1587
Default Re: Little coding questions - For general minor queries 5

Quote:
Originally Posted by v4yne1 View Post
i want to make a tower climbing minigame. i thought about using virtual worlds for each player so every player has its own tower to climb on (to prevent crowd). i wonder if using 20 virtual worlds at once will cause any lag on my server? thanks in advance
That should not be an issue. It might even be faster: when you have 20 players in the same virtual/main world they must all be synced all the time. When everyone is in a seperate world this is not the case.
Atleast that is what I suspect. It seems most logic that way. Correct me if I am wrong, anyone.
Kwarde is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to make a soldier aotumaticly be general when the general dies ? AlbanianGuy Scripting Help 35 13/05/2012 03:35 PM
Minor problem Desert Help Archive 4 17/03/2010 06:24 PM
Counting with mysql queries actiwe Help Archive 2 26/02/2010 02:36 PM
SQL queries using GROUP BY Dabombber Help Archive 1 05/10/2009 07:47 PM


All times are GMT. The time now is 12:19 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.