Function Creation Help
Posted: Wed Nov 26, 2008 5:37 pm
Well I'm making a global code, so i can have a fademusic function. But I'm having trouble with the problems it tells me.
Heres the code
I then try to add it but it says "unknown type 'fadespeed': possible old C type declaration"
I then tried adding char in front of the fadespeed and fadestop,
It worked, but you have to put it in draw actor. When I tried it in game mode it said "view -> Draw Actor, line 1: link error: undefined function -> fademusic" I did define it in the global code. It even went yellow like a function should do. Whats wrong?
Heres the code
- Code: Select all
int funcend;
float fadespeed, fadestop;
void fademusic(fadespeed, fadestop);
if(funcend == 0)
{
setVolume(1, musicvol); //musicvol is a built in variable\\
musicvol -= fadespeed;
}
if(musicvol == fadestop)
{
funcend = 1;
}
I then try to add it but it says "unknown type 'fadespeed': possible old C type declaration"
I then tried adding char in front of the fadespeed and fadestop,
- Code: Select all
void fademusic(char fadespeed, char fadestop);
It worked, but you have to put it in draw actor. When I tried it in game mode it said "view -> Draw Actor, line 1: link error: undefined function -> fademusic" I did define it in the global code. It even went yellow like a function should do. Whats wrong?