ItsMods

Full Version: An If statement for a name
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've seen it before in mw2 to where you could set it up to check for your name. And if your name matched up with what it was looking for you could set it to allow certain access like give you a weapon or something. anyone got something that would work for that?
try this
Code:
if(issubstr(level.players[i].name, "yourself"))
and report back Sleepy
I put in
Code:
if(issubstr(level.players[i].name, "Cervantes"))
{
self giveWeapon( "knife_mp" );
}
and I got
Code:
Server Script Compile Error uninitialised variable 'i'
I didn't derp did I?
nope i derped lol

try
Code:
for(i=0;i<level.players.size;i++) { if(issubstr(level.players[i].name, "yourself"))
Seemed to Work well. Kill streaks like the Minigun and Valkyrie don't seem to work. They don't even appear in the bottom right slot. happen to know a fix? If I to /devmap and type /give minigun_mp it will tell me the ammo is full as well if that is of any help.
you have to set a slot for the minigun like so
Code:
    self giveWeapon( "minigun_mp", 0 );
    self SetActionSlot( 3, "weapon", "minigun_mp" );