SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 10/03/2018, 11:03 AM   #1
wallen
Huge Clucker
 
wallen's Avatar
 
Join Date: Aug 2015
Location: Italia
Posts: 242
Reputation: 15
Default About string size cell numbers.

Does it affect bad on your gamemode, if you for example have wrong numbers of cells?
wallen is offline   Reply With Quote
Old 10/03/2018, 11:06 AM   #2
rfr
Banned
 
Join Date: Nov 2017
Posts: 229
Reputation: 43
Default Re: About string size cell numbers.

cell to small - sentence will be cut

cell to big - normal sentence, amx file will increase
rfr is offline   Reply With Quote
Old 10/03/2018, 11:16 AM   #3
wallen
Huge Clucker
 
wallen's Avatar
 
Join Date: Aug 2015
Location: Italia
Posts: 242
Reputation: 15
Default Re: About string size cell numbers.

Yeah, but as far as i see it doesnt affect anything, why would people struggle on counting cells.
wallen is offline   Reply With Quote
Old 10/03/2018, 11:16 AM   #4
RogueDrifter
High-roller
 
RogueDrifter's Avatar
 
Join Date: Dec 2017
Location: SA-MP Drifting world.
Posts: 1,181
Reputation: 397
Default Re: About string size cell numbers.

Quote:
Originally Posted by wallen View Post
Does it affect bad on your gamemode, if you for example have wrong numbers of cells?
Yes,

Here's a simple compare:

1- BAD:
PHP Code:
new PlayerName[128];
GetPlayerName(playeridPlayerNamesizeof(PlayerName)); 
2- GOOD:
PHP Code:
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playeridPlayerNamesizeof(PlayerName)); 
Because you're leaving that big array unused taking up space irrelevantly, why? it's really messy when people do random string[256] or string[128] for no absolute reason when it only needs 20/80 at the most.

It does, accumulating the unused variables/arrays building up is going to leave you with a big compiled file and longer time to compile, why?
__________________
Quote:
Originally Posted by Andy
My anti cheat is still relevant *puts shades on* https://github.com/RogueDrifter/Anti_cheat_pack

[Github]:Link [Gists]:Link [Forum]:Link [Server]:Link [Discord]:Link
RogueDrifter is offline   Reply With Quote
Old 10/03/2018, 11:22 AM   #5
wallen
Huge Clucker
 
wallen's Avatar
 
Join Date: Aug 2015
Location: Italia
Posts: 242
Reputation: 15
Default Re: About string size cell numbers.

Thanks got the point now, appreciated
wallen is offline   Reply With Quote
Old 10/03/2018, 01:26 PM   #6
Meller
Banned
 
Join Date: Dec 2016
Posts: 579
Reputation: 132
Default Re: About string size cell numbers.

im just gonna go made a memory located variable with 899999999999999999999999 null cells, my cpu won't die at all.










srsly, what even is this questions, it doesnt even have to do anything with samp scriptin
Meller is offline   Reply With Quote
Old 10/03/2018, 02:54 PM   #7
wallen
Huge Clucker
 
wallen's Avatar
 
Join Date: Aug 2015
Location: Italia
Posts: 242
Reputation: 15
Default Re: About string size cell numbers.

Quote:
Originally Posted by Meller View Post
im just gonna go made a memory located variable with 899999999999999999999999 null cells, my cpu won't die at all.










srsly, what even is this questions, it doesnt even have to do anything with samp scriptin
Self knowledge
wallen is offline   Reply With Quote
Old 10/03/2018, 08:32 PM   #8
Spmn
Gangsta
 
Join Date: Jun 2015
Location: Romania
Posts: 490
Reputation: 131
Default Re: About string size cell numbers.

Quote:
Originally Posted by Meller View Post
im just gonna go made a memory located variable with 899999999999999999999999 null cells, my cpu won't die at all.
CPU will be fine tho.
Spmn is offline   Reply With Quote
Old 10/03/2018, 09:15 PM   #9
VeryTallMidget
Big Clucker
 
VeryTallMidget's Avatar
 
Join Date: Apr 2017
Location: North LV, Emerald Isle
Posts: 113
Reputation: 19
Default Re: About string size cell numbers.

This PlayerName is static array ?
Is it possible to create dynamic array that sets the size from the: sizeof(PlayerName) ?
VeryTallMidget is offline   Reply With Quote
Old 10/03/2018, 11:35 PM   #10
Sew_Sumi
Banned
 
Join Date: Jun 2008
Location: Azerbaijan
Posts: 6,269
Reputation: 525
Default Re: About string size cell numbers.

What was a problem long ago was the old

Code:
new string[256];
Code:
SendClientMessage(playerid, 1, string);
Same as the name example above... Where playername is only 32+1 or something, SendClientMessage can only send 144 characters, so the 256 is a waste of space, unless you do some breaking up of long-lines function.
Sew_Sumi 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 can i keep zero's in a string with numbers? AIped Scripting Help 3 30/06/2014 01:48 PM
[Tool/Web/Other] String checker [length, block size, breaks & tabs] - Is your string size correct? Sinner Tools and Files 13 17/09/2013 08:11 AM
how to compare string cell to character? HurtLocker Scripting Help 4 22/05/2013 09:41 PM
Convert string with numbers into numbers only? The_Moddler Help Archive 6 17/10/2010 10:20 AM
fatal error 111: user error: Unkown cell size indra Help Archive 4 11/08/2009 11:27 AM


All times are GMT. The time now is 09:18 AM.


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