SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 23/03/2008, 11:11 AM   #11
ConTron
Big Clucker
 
Join Date: Mar 2007
Posts: 72
Reputation: 1
Default Re: Little coding questions - For general minor queries 5

Quote:
Originally Posted by mabako
[SCF]ConTron:

if it doesn't show the SendClientMessage, you're doing something wrong somewhere else. Plus you don't need HideMenu in the callback for when a row was selected. (however it may be called)
I dont get it though, i copied it from a working bit of the menu. I just dont know why it dosent teleport me
ConTron is offline   Reply With Quote
Old 24/03/2008, 03:05 AM   #12
Redirect Left
High-roller
 
Redirect Left's Avatar
 
Join Date: Mar 2007
Location: Yorkshire, England
Posts: 1,281
Reputation: 358
Default Re: Little coding questions - For general minor queries 5

Are there any known limits on how many people can be banned? I mean, surely eventually the samp ban file will become so big it'll be hard to read, and slow down stuff, yes/no?

(Sorry, I'm just trying to debug my servers instability and my SSH reporting weird errors)
Redirect Left is offline   Reply With Quote
Old 24/03/2008, 06:03 AM   #13
!damo!spiderman
Huge Clucker
 
!damo!spiderman's Avatar
 
Join Date: Oct 2006
Posts: 469
Reputation: 147
Default Re: Little coding questions - For general minor queries 5

We were just discussing this actually... a ban file of over 1000 you'll see a considerable amount of increase in cpu usage. For larger servers we'd probably suggest using a sqllite database to check for bans. Or just clear you ban file every couple of months
__________________
!damo!spiderman is offline   Reply With Quote
Old 25/03/2008, 02:27 AM   #14
Dabombber
Big Clucker
 
Join Date: May 2006
Posts: 81
Reputation: 1
Default Re: Little coding questions - For general minor queries 5

For strings in enumerations, something like

Code:
enum e_test { bla[50] }
new test[e_test];
printf("sizeof bla = %i", sizeof(test[bla]));
works fine, but how would you get the size from a multidimensional array like

Code:
new test[10][e_test]
Dabombber is offline   Reply With Quote
Old 25/03/2008, 03:08 AM   #15
yom
High-roller
 
Join Date: Jul 2006
Posts: 2,005
Reputation: 6
Default Re: Little coding questions - For general minor queries 5

Edit: sorry misread.
yom is offline   Reply With Quote
Old 25/03/2008, 07:40 AM   #16
!damo!spiderman
Huge Clucker
 
!damo!spiderman's Avatar
 
Join Date: Oct 2006
Posts: 469
Reputation: 147
Default Re: Little coding questions - For general minor queries 5

Code:
sizeof( test[0][bla] );
Replace 0 with whatever cell you want to check
__________________
!damo!spiderman is offline   Reply With Quote
Old 25/03/2008, 08:28 AM   #17
Dabombber
Big Clucker
 
Join Date: May 2006
Posts: 81
Reputation: 1
Default Re: Little coding questions - For general minor queries 5

Code:
enum e_test { bla[50] }
new test[10][e_test];
printf("sizeof bla = %i", sizeof(test[0][bla]));
doesn't even compile
Dabombber is offline   Reply With Quote
Old 25/03/2008, 03:39 PM   #18
homie.pl
Little Clucker
 
Join Date: May 2007
Posts: 15
Reputation: 0
Default Re: Little coding questions - For general minor queries 5

Try
Code:
enum e_test { bla[50] }
new test[10][e_test];
printf("sizeof bla = %i", strlen(test[0][bla]));
I've got also question about multidimensional array but with enumeration. When I create for example array:
Code:
new ObjectInfo[200][oInfo];
that has enumeration:
Code:
enum oInfo
{
	realid[MAX_PLAYERS],
	modelid,
	Float:x,
	Float:y,
	Float:z,
	Float:rx,
	Float:ry,
	Float:rz,
	bool:isset[MAX_PLAYERS]
}
then I put numbers in and I print the modelid of first 8 dimensions from array
Code:
[15:57] 615
[15:57] 615
[15:57] 615
[15:57] 3249
[15:57] 3241
[15:57] 744
[15:57] 744
[15:57] 744
This is what I need. Everything is proper. But when I change

Code:
new ObjectInfo[200][oInfo];
to
Code:
new ObjectInfo[][oInfo];
I get printed
Code:
[15:58] 0
[15:58] 579
[15:58] 615
[15:58] 0
[15:58] 3241
[15:58] 744
[15:58] 744
[15:58] 744
As you can see few numbers are printed correctly, but rest not.

And here's my question, why does it happen. And I cannot use number to set number of dimensions, because I'd have to use 5000 which makes my script almost 2MB large.
homie.pl is offline   Reply With Quote
Old 25/03/2008, 08:10 PM   #19
homie.pl
Little Clucker
 
Join Date: May 2007
Posts: 15
Reputation: 0
Default Re: Little coding questions - For general minor queries 5

Ok but when I set number of dimensions I get 2MB amx... Is there any way to reduce this size?
homie.pl is offline   Reply With Quote
Old 28/03/2008, 02:37 AM   #20
Backwardsman97
High-roller
 
Backwardsman97's Avatar
 
Join Date: Nov 2007
Posts: 2,201
Reputation: 36
Default Re: Little coding questions - For general minor queries 5

Did they clean up this topic?
Backwardsman97 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 2 05/10/2009 08:47 PM


All times are GMT. The time now is 02:05 AM.


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