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, 10:03 AM   #1
wallen
Huge Clucker
 
wallen's Avatar
 
Join Date: Aug 2015
Location: Italia
Posts: 264
Reputation: 11
Default About string size cell numbers.

Does it affect bad on your gamemode, if you for example have wrong numbers of cells?
__________________
Los Santos DM Battleground
wallen is offline   Reply With Quote
Old 10/03/2018, 10:06 AM   #2
rfr
Banned
 
Join Date: Nov 2017
Posts: 306
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, 10:16 AM   #3
wallen
Huge Clucker
 
wallen's Avatar
 
Join Date: Aug 2015
Location: Italia
Posts: 264
Reputation: 11
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.
__________________
Los Santos DM Battleground
wallen is offline   Reply With Quote
Old 10/03/2018, 10:16 AM   #4
RogueDrifter
High-roller
 
RogueDrifter's Avatar
 
Join Date: Dec 2017
Location: SA-MP Drifting world.
Posts: 1,497
Reputation: 325
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?
__________________
Code:
I'm available to script stuff for cash PM me here or on discord @ Andy[RDZ]#0040
[Tutorial]:Anti-cheat guide ||Mini-game 101||VC/LC maps install||
Array index out of bounds


[Github]:Link [Pastebin]:Link [Forum]:Link [Server]:Link [Discord]:Link




Code:
You may only contact me through the links on my signature, if else then its an impersonating one, i am not on any other place not mentioned in my signature.
RogueDrifter is online now   Reply With Quote
Old 10/03/2018, 10:22 AM   #5
wallen
Huge Clucker
 
wallen's Avatar
 
Join Date: Aug 2015
Location: Italia
Posts: 264
Reputation: 11
Default Re: About string size cell numbers.

Thanks got the point now, appreciated
__________________
Los Santos DM Battleground
wallen is offline   Reply With Quote
Old 10/03/2018, 12:26 PM   #6
Meller
Banned
 
Join Date: Dec 2016
Posts: 644
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, 01:54 PM   #7
wallen
Huge Clucker
 
wallen's Avatar
 
Join Date: Aug 2015
Location: Italia
Posts: 264
Reputation: 11
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
__________________
Los Santos DM Battleground
wallen is offline   Reply With Quote
Old 10/03/2018, 07:32 PM   #8
Spmn
Gangsta
 
Join Date: Jun 2015
Location: Romania
Posts: 537
Reputation: 129
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, 08:15 PM   #9
VeryTallMidget
Big Clucker
 
VeryTallMidget's Avatar
 
Join Date: Apr 2017
Location: North LV, Emerald Isle
Posts: 97
Reputation: 14
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) ?
__________________
Click Here !

Useful stuff:
VeryTallMidget is offline   Reply With Quote
Old 10/03/2018, 10:35 PM   #10
Sew_Sumi
Godfather
 
Join Date: Jun 2008
Location: Azerbaijan
Posts: 6,216
Reputation: 515
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 online now   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 12: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 07:11 AM
how to compare string cell to character? HurtLocker Scripting Help 5 22/05/2013 08:41 PM
Convert string with numbers into numbers only? The_Moddler Help Archive 6 17/10/2010 09:20 AM
fatal error 111: user error: Unkown cell size indra Help Archive 4 11/08/2009 10:27 AM


All times are GMT. The time now is 07:55 PM.


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