View Single Post
MasterOfTheXP
Veteran Member
Join Date: Aug 2011
Location: Cloudbank
Old 01-27-2013 , 17:59   Re: [TF2] Jetpack Plugin (with realistic effect)
Reply With Quote #5

Quote:
Originally Posted by Death Commando View Post
The only problem is, when someone uses it, the flames shoot out the back of every player, not just you. I have been unable to fix the problem, so if anyone knows how to make effects work only on the user, i would appreciate the help.
PHP Code:
for(new 1<= g_iMaxClientsi++)
        {
            if(
g_bJetpacks[i])
            {
                if(!
IsAlive(i)) StopJetpack(i);
                else 
AddVelocity(iGetConVarFloat(sm_jetpack_speed));
                
                for (new 
iClient 1iClient <= MaxClientsiClient++)
                {
                      
// Attach particle 
That looks like the issue to me. You're attaching the particle to all players for each player that is jetpacking.

Also...what's with the g_iMaxClients thing? It's not needed, at all (especially due to the fact that GetMaxClients is to be deprecated eventually) just use MaxClients like your for-loop-within-a-for-loop uses.
__________________
Plugins / My Steam / TF2 Sandbox (plugin beta testing!)
MasterOfTheXP is offline