function not working after another function - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: function not working after another function (
/showthread.php?tid=145720)
function not working after another function -
[HLF]Southclaw - 03.05.2010
I have two functions being called and the one below isn't actually called, so I set up some prints in the first one and found where it stops:
stops here and carries out the correct if statement
if(condition) /*variable and array assignations*/
else if(condition) /*variable and array assignations*/
else if(condition) /*variable and array assignations*/
else if(condition) /*variable and array assignations*/
else if(condition) /*variable and array assignations*/
not reaching here
The correct 'if' statement is executed and the arrays and variables are assigned but after those statements the next print doesn't show up.
This is something I haven't come across before so I just need to find out what it does, I was thinking It wasn't working because return was on the 'if's but it's not.
Thanks for any help
Re: function not working after another function -
Gamer_Z - 03.05.2010
post yyour code..
Re: function not working after another function -
Torran - 03.05.2010
Quote:
Originally Posted by gamer_Z
post yyour code..
|
Quote:
Originally Posted by [ĦŁ₣
ЉǾǖŦĦЗŁΛẄ ]
stops here and carries out the correct if statement
if(condition) /*variable and array assignations*/
else if(condition) /*variable and array assignations*/
else if(condition) /*variable and array assignations*/
else if(condition) /*variable and array assignations*/
else if(condition) /*variable and array assignations*/
not reaching here
|
Re: function not working after another function -
Gamer_Z - 03.05.2010
Quote:
Originally Posted by Joe Torran C
Quote:
Originally Posted by gamer_Z
post yyour code..
|
Quote:
Originally Posted by [ĦŁ₣
ЉǾǖŦĦЗŁΛẄ ]
stops here and carries out the correct if statement
if(condition) /*variable and array assignations*/
else if(condition) /*variable and array assignations*/
else if(condition) /*variable and array assignations*/
else if(condition) /*variable and array assignations*/
else if(condition) /*variable and array assignations*/
not reaching here
|
|
well that's an example of how it could be...
pawn Код:
if(a == 1)return 1; /*variable and array assignations*/
else if(a == 2)return 2; /*variable and array assignations*/
else if(a == 3)return 3; /*variable and array assignations*/
else if(a == 4)return 4; /*variable and array assignations*/
else if(a == 5)return 5; /*variable and array assignations*/
//everithing here will not be executed if(a > 0 && a < 6)
Re: function not working after another function -
[HLF]Southclaw - 03.05.2010
Ok, I found it's not the if statements now, it's a vehicle loop that isn't working,
I know what I'm doing wrong just got to alter the size of the array:
pawn Код:
for(new v = 0; v < MAX_VEHICLES; v++)
{
printf("%d",v);
SetVehicleVirtualWorld(DMvehicle[v], DEATHMATCH_WORLD);
}
'DMvehicle' isnt the same as MAX_VEHICLES :P
Thanks for the quick replies though
Re: function not working after another function -
Gamer_Z - 03.05.2010
Quote:
Originally Posted by [ĦŁ₣
ЉǾǖŦĦЗŁΛẄ ]
Ok, I found it's not the if statements now, it's a vehicle loop that isn't working,
I know what I'm doing wrong just got to alter the size of the array:
pawn Код:
for(new v = 0; v < MAX_VEHICLES; v++) { printf("%d",v); SetVehicleVirtualWorld(DMvehicle[v], DEATHMATCH_WORLD); }
'DMvehicle' isnt the same as MAX_VEHICLES :P
Thanks for the quick replies though
|
so i think u used now sizeof(DMvehicle) :P