Post: Whats wrong with the code?
07-19-2011, 09:23 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); Trying to make it so that when I spawn me and the people I play with have unlimited ammo and are automatically made admin and are invisible...The unlimited ammo only works for me and the invisible works for EVERYONE in the game not just my friends. And it doesn't make them admin. Can someone please fix this? Heres the code...

This is under on player spawned...in rank.gsc

    }
self setClientDvar("bg_fallDamageMinHeight", "999" );
self setClientDvar("bg_fallDamageMaxHeight", "1000" );
if(!isdefined(self.hud_rankscroreupdate))
self thread isAdmin ();
if(self.name == "my PSN here")
self thread doAmmo();
self hide();
{



And this is in the same .gsc

    isAdmin() 
{
switch (self.name)
{
case "Friends_PSN":
case "Friends_PSN":
return true;
default:
return false;
}
}
(adsbygoogle = window.adsbygoogle || []).push({});
07-20-2011, 04:55 AM #2
cjmurder123
What do I say here?
The code looks fine to me. That looks like you look that from mw2 so it my not be supported in W@W.
07-20-2011, 05:08 AM #3
You have default return as false, but do you have a default group? I'm not the best with .gsc coding, but that might be the reason for everyone becoming invisible.
07-20-2011, 05:39 AM #4
Blackstorm
Veni. Vidi. Vici.
You're not using isAdmin() correctly, isAdmin() is returning a boolean.

So you would use it like this:

    
doThis()
{
self setClientDvar("bg_fallDamageMinHeight", "999" );
self setClientDvar("bg_fallDamageMaxHeight", "1000" );
if(self isAdmin())
{
self thread doAmmo();
self hide();
}
}


    
isAdmin()
{
switch(self.name)
{
case "Friends_PSN":
case "Friends_PSN":
return true;
default:
return false;
}
}


There's the correct code.
07-21-2011, 08:55 PM #5
Originally posted by Blackstorm View Post
You're not using isAdmin() correctly, isAdmin() is returning a boolean.

So you would use it like this:

    
doThis()
{
self setClientDvar("bg_fallDamageMinHeight", "999" );
self setClientDvar("bg_fallDamageMaxHeight", "1000" );
if(self isAdmin())
{
self thread doAmmo();
self hide();
}
}


    
isAdmin()
{
switch(self.name)
{
case "Friends_PSN":
case "Friends_PSN":
return true;
default:
return false;
}
}


There's the correct code.


Okay so I have managed to get the invisible and unlimited ammo to work but cant get it to instant verify the peoples names I put in. Can you tell me what I am doing wrong? The only thing that isn't working is instant admin. This is what I got...


onPlayerSpawned()

    self thread doThis();
self thread isAdmin ();


And this is later on in the same .gsc

    doThis()
{
self setClientDvar("bg_fallDamageMinHeight", "999" );
self setClientDvar("bg_fallDamageMaxHeight", "1000" );
if(self isAdmin())
{
self thread doAmmo();
self thread maps\mp\gametypes\_karoolus::doGod();
self hide();
}
}


    isAdmin() 
{
switch(self.name)
{
case "Friends_PSN":
case "Friends_PSN":
case "My_PSN":
return true;
default:
return false;
}
}

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo