SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 09/04/2019, 01:43 PM   #4121
Nero_3D
High-roller
 
Nero_3D's Avatar
 
Join Date: Jun 2007
Location: Germany
Posts: 2,831
Reputation: 666
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, 07: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, 06:20 AM   #4123
Kwarde
High-roller
 
Kwarde's Avatar
 
Join Date: Nov 2009
Location: The Netherlands
Posts: 2,440
Reputation: 1620
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
Old 26/09/2019, 09:31 PM   #4124
MrAuto
Little Clucker
 
Join Date: Sep 2019
Posts: 6
Reputation: 0
Default Re: Little coding questions - For general minor queries 5

Quote:
Originally Posted by Kwarde View Post
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.
It doesn't matter, if you would let players desync in virtual world then bringing them back would require sync again, that much more complicated then just sync them no matter what. Also players are not sync to each other but to the server itself.

From what i know changing virtual world only affect what players sees, what is loaded for him (objects, cars, other players etc.). It can help if someone has old pc, getting rid of other players models could increese fps for them.

As to the server, it doesn't matter at all how many you use as long as you in the max limit of virtual worlds.
MrAuto is offline   Reply With Quote
Old 10/10/2019, 06:02 PM   #4125
Sh4rp
Little Clucker
 
Join Date: Sep 2019
Location: Italy
Posts: 27
Reputation: 14
Default Re: Little coding questions - For general minor queries 5

Can somebody provide a tutorial on how to create smooth camera sequences using InterpolateCameraPos/LookAt please?
Ex.: I have 7 different coordinates from which the camera needs to pass through in a x amount of time. Atm, with my code, the camera stops and after an undefined amount of seconds it begins it's second transition, same goes for the third, then the fourth, etc.
__________________
Discord contact: @Sharp#1708
Sh4rp is offline   Reply With Quote
Old 03/11/2019, 11:37 PM   #4126
Spectrum
Little Clucker
 
Spectrum's Avatar
 
Join Date: Nov 2019
Posts: 1
Reputation: 0
Default Re: Little coding questions - For general minor queries 5

Quote:
Originally Posted by Sh4rp View Post
Can somebody provide a tutorial on how to create smooth camera sequences using InterpolateCameraPos/LookAt please?
Ex.: I have 7 different coordinates from which the camera needs to pass through in a x amount of time. Atm, with my code, the camera stops and after an undefined amount of seconds it begins it's second transition, same goes for the third, then the fourth, etc.
https://forum.sa-mp.com/showthread.php?t=330879

I think this topic will help you.
Spectrum 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 04:35 PM
Minor problem Desert Help Archive 4 17/03/2010 07:24 PM
Counting with mysql queries actiwe Help Archive 2 26/02/2010 03:36 PM
SQL queries using GROUP BY Dabombber Help Archive 1 05/10/2009 08:47 PM


All times are GMT. The time now is 10:36 AM.


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