function onPlayerCommand( pPlayer, szCommand, szText ){ if ( szCommand == "veh" ) { CreateVehicle( VEH_INFERNUS, pPlayer.Pos, pPlayer.Angle, -1, -1 ); } return 1;}
function onPlayerCommand( pPlayer, szCmd, szParams ){ if ( szCmd == "mypos" ) { local v = pPlayer.Pos; Message( pPlayer.Name + " is currently at " + v.x + ", " + v.y + ", " + v.z ); } else if ( szCmd == "spawncar" ) { if ( szParams ) { local pTemp = split( szParams, " " ), ID = 90; if ( IsNum( pTemp[ 0 ] ) ) ID = pTemp[ 0 ].tointeger(); if ( ( ID >= 90 ) && ( ID <= 150 ) ) { local v = pPlayer.Pos; MessagePlayer( "Spawning a vehicle with model ID " + ID + "...", pPlayer ); CreateVehicle( ID, Vector( v.x + 5, v.y, v.z ), pPlayer.Angle ); } } } else if ( szCmd == "health" ) { if ( !szParams ) MessagePlayer( "Your Health: " + pPlayer.Health, pPlayer ); else { local pTemp = split( szParams, " " ), p = GetPlayer( pTemp[ 0 ] ); if ( p ) { if ( p.Spawned ) MessagePlayer( pPlayer.Name + "'s Health: " + p.Health, pPlayer ); else MessagePlayer( "This person isn't spawned nub!", pPlayer ); } else MessagePlayer( "Can't find anyone with that id/nick", pPlayer ); } } else if ( szCmd == "armour" ) { if ( !szParams ) MessagePlayer( "Your Armour: " + pPlayer.Armour, pPlayer ); else { local pTemp = split( szParams, " " ), p = GetPlayer( pTemp[ 0 ] ); if ( p ) { if ( p.Spawned ) MessagePlayer( pPlayer.Name + "'s Armour: " + p.Armour, pPlayer ); else MessagePlayer( "This person isn't spawned nub!", pPlayer ); } else MessagePlayer( "Can't find anyone with that id/nick", pPlayer ); } } else if ( szCmd == "goto" ) { if ( !szParams ) MessagePlayer( "Error - Need to specify a target player.", pPlayer ); else { local pTemp = split( szParams, " " ), p = GetPlayer( pTemp[ 0 ] ); if ( p ) { if ( p.Spawned ) { Message( "Taking " + pPlayer.Name + " to " + p.Name, Colour( 0, 255, 0 ) ); pPlayer.Pos = p.Pos; pPlayer.Pos.y += 5; pPlayer.Pos.z += 2; } else MessagePlayer( "This person isn't spawned nub!", pPlayer ); } else MessagePlayer( "Can't find anyone with that id/nick", pPlayer ); } } else if ( szCmd == "bring" ) { if ( !szParams ) MessagePlayer( "Error - Need to specify a target player.", pPlayer ); else { local pTemp = split( szParams, " " ), p = GetPlayer( pTemp[ 0 ] ); if ( p ) { if ( p.Spawned ) { Message( "Taking " + p.Name + " to " + pPlayer.Name, Colour( 0, 255, 0 ) ); p.Pos = pPlayer.Pos; p.Pos.y += 5; p.Pos.z += 2; } else MessagePlayer( "This person isn't spawned nub!", pPlayer ); } else MessagePlayer( "Can't find anyone with that id/nick", pPlayer ); } } return 1;}function GetPlayer( target ){ target = target.tostring(); if ( IsNum( target ) ) { target = target.tointeger(); if ( FindPlayer( target ) ) return FindPlayer( target ); else return null; } else if ( FindPlayer( target ) ) return FindPlayer( target ); else return null;}
Oo thank you, I see that I changed some things