SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Scripting Help (https://forum.sa-mp.com/forumdisplay.php?f=12)
-   -   Little coding questions - For general minor queries 5 (https://forum.sa-mp.com/showthread.php?t=30938)

Orpheus 27/07/2008 10:17 AM

Re: Little coding questions - For general minor queries 5
 
Quick Question, Pointless in searching for such a random thing, as the search params could be UNBELIEVABLY random

IS it possible to make an array read from a MAX point and a MIN point , so if you wanted to shorted an array for your WEATHER array, is it possible to mkae it loop from MAX weather to MIN weather?
so if the MAX u wanted was 46 and the MIN you wanted was 1?

if so how would you do it? would it be the basic loop?

mamorunl 27/07/2008 12:34 PM

Re: Little coding questions - For general minor queries 5
 
well, as you actually said the answer yourself, you could make a timer with a random() function

Orpheus 27/07/2008 02:39 PM

Re: Little coding questions - For general minor queries 5
 
... I was on about the actual arrays... but it don't matter anymore, as my randomness filterscript is complete...

gatokpo 27/07/2008 05:57 PM

Re: Little coding questions - For general minor queries 5
 
Quote:

Originally Posted by [NT
SpeedDevil ]
Quote:

Originally Posted by gatokpo
When the error is "undefined symbol: x".
What i have to do?
The script im doing is:
if (strcmp("/allah", cmdtext, true) == 0)
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
CreateExplosion(x, y, z, 3, 10);
{

return 1;
}
return 0;
}

I know its possible really bad... and you are possibly lauhging about it...
Im not too good at scripting.

you need to define X, Y and Z

How i can define it?
i know that i have to do somwthing like:
"new Float: x,Float: y,Float: z"
CAn you tell me what i have to remove/add to that?

mamorunl 27/07/2008 08:02 PM

Re: Little coding questions - For general minor queries 5
 
I have made it for you, the code in the red was missing :)


// and for my own problem: I have now created another command with the udb_encode line and that one works like a charm. Except when I have used my login command before.

Orpheus 27/07/2008 09:09 PM

Re: Little coding questions - For general minor queries 5
 
If your login commmands uses the same code it could block it out :s just a thought dnt hold me to it, cos i'm not certain


gatokpo 27/07/2008 09:17 PM

Re: Little coding questions - For general minor queries 5
 
Quote:

Originally Posted by [NT
SpeedDevil ]
I have made it for you, the code in the red was missing :)


// and for my own problem: I have now created another command with the udb_encode line and that one works like a charm. Except when I have used my login command before.

Sorry, i didnt realize it XD.
Any way it doesnt work :(
the errors are:
C:\DOCUME~1\ADMINI~1\ESCRIT~1\SAMPSE~1\FILTER~1\LO CALI~1.PWN(111) : warning 217: loose indentation
C:\DOCUME~1\ADMINI~1\ESCRIT~1\SAMPSE~1\FILTER~1\LO CALI~1.PWN(113) : warning 213: tag mismatch
C:\DOCUME~1\ADMINI~1\ESCRIT~1\SAMPSE~1\FILTER~1\LO CALI~1.PWN(113) : warning 202: number of arguments does not match definition
C:\DOCUME~1\ADMINI~1\ESCRIT~1\SAMPSE~1\FILTER~1\LO CALI~1.PWN(133) : error 003: declaration of a local variable must appear in a compound block
C:\DOCUME~1\ADMINI~1\ESCRIT~1\SAMPSE~1\FILTER~1\LO CALI~1.PWN(133) : warning 221: label name "Float" shadows tag name
C:\DOCUME~1\ADMINI~1\ESCRIT~1\SAMPSE~1\FILTER~1\LO CALI~1.PWN(133) : warning 217: loose indentation
C:\DOCUME~1\ADMINI~1\ESCRIT~1\SAMPSE~1\FILTER~1\LO CALI~1.PWN(133) : error 017: undefined symbol "x"
C:\DOCUME~1\ADMINI~1\ESCRIT~1\SAMPSE~1\FILTER~1\LO CALI~1.PWN(133) : warning 215: expression has no effect
C:\DOCUME~1\ADMINI~1\ESCRIT~1\SAMPSE~1\FILTER~1\LO CALI~1.PWN(134) : warning 217: loose indentation
C:\DOCUME~1\ADMINI~1\ESCRIT~1\SAMPSE~1\FILTER~1\LO CALI~1.PWN(134) : error 017: undefined symbol "x"
C:\DOCUME~1\ADMINI~1\ESCRIT~1\SAMPSE~1\FILTER~1\LO CALI~1.PWN(135) : error 017: undefined symbol "x"
C:\DOCUME~1\ADMINI~1\ESCRIT~1\SAMPSE~1\FILTER~1\LO CALI~1.PWN(140) : warning 225: unreachable code
C:\DOCUME~1\ADMINI~1\ESCRIT~1\SAMPSE~1\FILTER~1\LO CALI~1.PWN(133) : warning 203: symbol is never used: "Float"

Orpheus 27/07/2008 09:31 PM

Re: Little coding questions - For general minor queries 5
 
indentations surly you can fix...

define X (Y and Z too )with this

new Float: x;
new Float: y;
new Float: z;

if line 140 is a return 1; then its because it outisde your main brackets ;0 e.g u probably have
return 1;
}

too much

Regards Orph

gatokpo 27/07/2008 09:58 PM

Re: Little coding questions - For general minor queries 5
 
Quote:

Originally Posted by Orpheus

if line 140 is a return 1; then its because it outisde your main brackets ;0 e.g u probably have
return 1;
}

too much

Regards Orph

So... how to fix it? :P.
Thanks for the other part ;), it worked :)

gatokpo 27/07/2008 10:00 PM

Re: Little coding questions - For general minor queries 5
 
Cause the only error i have is:
error 003: declaration of a local variable must appear in a compound block


All times are GMT. The time now is 06:12 AM.

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