SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 03/05/2010, 03:31 PM   #1
[HLF]Southclaw
High-roller
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 4,432
Reputation: 936
Default function not working after another function

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
[HLF]Southclaw is offline  
Old 03/05/2010, 03:50 PM   #2
Gamer_Z
High-roller
 
Gamer_Z's Avatar
 
Join Date: Jun 2009
Location: Fontys Uni. - Applied Sciences (Currently doing the hardest possible study Fontys has to offer)
Posts: 2,627
Reputation: 819
Default Re: function not working after another function

post yyour code..
__________________

Google code not working? Try GitHub
Gamer_Z is offline  
Old 03/05/2010, 03:59 PM   #3
Torran
High-roller
 
Join Date: Jan 2010
Posts: 1,794
Reputation: 1
Default Re: function not working after another function

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
Torran is offline  
Old 03/05/2010, 04:07 PM   #4
Gamer_Z
High-roller
 
Gamer_Z's Avatar
 
Join Date: Jun 2009
Location: Fontys Uni. - Applied Sciences (Currently doing the hardest possible study Fontys has to offer)
Posts: 2,627
Reputation: 819
Default Re: function not working after another function

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 Code:
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)
__________________

Google code not working? Try GitHub
Gamer_Z is offline  
Old 03/05/2010, 04:10 PM   #5
[HLF]Southclaw
High-roller
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 4,432
Reputation: 936
Default Re: function not working after another function

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 Code:
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
[HLF]Southclaw is offline  
Old 03/05/2010, 05:45 PM   #6
Gamer_Z
High-roller
 
Gamer_Z's Avatar
 
Join Date: Jun 2009
Location: Fontys Uni. - Applied Sciences (Currently doing the hardest possible study Fontys has to offer)
Posts: 2,627
Reputation: 819
Default Re: function not working after another function

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 Code:
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
__________________

Google code not working? Try GitHub
Gamer_Z is offline  
 

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
Custom function isn't working biltong Help Archive 7 08/04/2010 06:05 PM
function not working as desired >_< aNdReSkKkK Help Archive 1 21/01/2010 03:29 PM
[SERIOUS PROBLEM] Function not Working!!!![NEED SERIOUS HELP!] Tigerbeast11 Help Archive 16 13/10/2009 06:13 PM
Is It A Function? sidhu123 Everything and Nothing 2 20/09/2009 12:16 PM
Function not working XeoN_13 Help Archive 3 05/09/2009 08:03 AM


All times are GMT. The time now is 11:31 PM.


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