Raised This Month: $51 Target: $400
 12% 

[HL2DM] Airboat spawner


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Alienmario
Senior Member
Join Date: Aug 2013
Plugin ID:
4904
Plugin Version:
1.0
Plugin Category:
Fun Stuff
Plugin Game:
Half-Life 2 Deathmatch
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Simple airboat spawner!
    Old 11-13-2015 , 20:23   [HL2DM] Airboat spawner
    Reply With Quote #1

    Commands:
    • !airboat - spawns an airboat
    Cvars:
    Quote:
    sm_vehicle_adminonly [default=1] If 1, only admins with kick flag can spawn vehicles.
    • Has a limit of 10 vehicles per map!
    Attached Files
    File Type: sp Get Plugin or Get Source (airboats.sp - 1010 views - 2.7 KB)

    Last edited by Alienmario; 11-13-2015 at 20:23.
    Alienmario is offline
    painkiller
    Senior Member
    Join Date: Jun 2011
    Old 03-23-2022 , 08:42   Re: [HL2DM] Airboat spawner
    Reply With Quote #2

    Would it please be possible to use the function via

    RegAdminCmd instead of via RegConsoleCmd?
    painkiller is offline
    Sreaper
    髪を用心
    Join Date: Nov 2009
    Old 03-23-2022 , 18:19   Re: [HL2DM] Airboat spawner
    Reply With Quote #3

    Quote:
    Originally Posted by painkiller View Post
    Would it please be possible to use the function via

    RegAdminCmd instead of via RegConsoleCmd?
    Untested.
    Attached Files
    File Type: sp Get Plugin or Get Source (airboats.sp - 135 views - 1.2 KB)

    Last edited by Sreaper; 03-23-2022 at 18:25.
    Sreaper is offline
    painkiller
    Senior Member
    Join Date: Jun 2011
    Old 04-17-2022 , 10:28   Re: [HL2DM] Airboat spawner
    Reply With Quote #4

    Thank you sweaper,

    I just saw it now.

    It works, but not with the desired effect.
    Let me try a little more.
    If it doesn't work then I'll let you know what it's needed for.

    Last edited by painkiller; 04-17-2022 at 10:45.
    painkiller is offline
    daren adler
    Member
    Join Date: Aug 2017
    Location: Iowa
    Old 09-20-2022 , 20:31   Re: [HL2DM] Airboat spawner
    Reply With Quote #5

    I know this is old but i tryed something and got the jeep to work. this is without the airboat

    Quote:
    #include <sourcemod>
    #include <sdktools>


    public Plugin:myinfo =
    {
    name = "Jeep spawner",
    author = "Origionally made by Alienmario - Remade by GuitarSlayer",
    description = "Simple jeep spawner",
    version = "0.1"
    };


    #define MAX_VEHICLES 10

    new number;
    new Handle:sm_vehicle_adminonly;
    public OnPluginStart(){
    RegConsoleCmd("sm_jeep", airboat, "spawn an airboat");
    //RegConsoleCmd("sm_jeep", airboat, "spawn a jeep");
    sm_vehicle_adminonly = CreateConVar("sm_vehicle_adminonly", "0", "Only admins can spawn vehicles", _, true, 0.0, true, 1.0);
    }

    public Action:airboat(client, args){
    if(!adminCheck(client)) return Plugin_Handled;
    if(client>0 && number<MAX_VEHICLES){
    new ent=CreateEntityByName("prop_vehicle_driveabl e");
    if(IsValidEdict(ent))
    {
    new Float:pos[3], Float:ang[3], Float:fwd[3];
    GetClientAbsOrigin(client, pos);
    GetClientAbsAngles(client, ang);
    GetAngleVectors(ang, fwd, NULL_VECTOR, NULL_VECTOR);
    ScaleVector(fwd, 300.0);
    ang[1]-=90;

    DispatchKeyValue(ent, "model", "models/buggy.mdl");// blodia/buggy
    DispatchKeyValue(ent, "vehiclescript", "scripts/vehicles/jeep_test.txt"); //"scripts/vehicles/buggy_edit.txt"
    DispatchKeyValue(ent, "actionScale", "1");
    DispatchKeyValue(ent, "EnableGun", "1");
    DispatchSpawn(ent);
    TeleportEntity(ent, pos, ang, fwd);
    ActivateEntity(ent);
    PrintToChat(client, "[SM] Spawned a buggy");
    number++;
    }
    }else{
    PrintToChat(client, "[SM] Failed, maybe there are too many vehicles already.");
    }
    return Plugin_Handled;
    }

    /*
    public Action:jeep(client, args){
    if(!adminCheck(client)) return Plugin_Handled;
    if(client>0 && number<MAX_VEHICLES){
    new ent=CreateEntityByName("prop_vehicle_driveabl e");
    if(IsValidEdict(ent))
    {
    new Float:pos[3], Float:ang[3], Float:fwd[3];
    GetClientAbsOrigin(client, pos);
    GetClientAbsAngles(client, ang);
    GetAngleVectors(ang, fwd, NULL_VECTOR, NULL_VECTOR);
    ScaleVector(fwd, 300.0);
    ang[1]-=90;

    DispatchKeyValue(ent, "model", "models/buggy.mdl");// blodia/buggy
    DispatchKeyValue(ent, "vehiclescript", "scripts/vehicles/jeep_test.txt"); //"scripts/vehicles/buggy_edit.txt"
    DispatchKeyValue(ent, "actionScale", "1");
    DispatchKeyValue(ent, "EnableGun", "1");
    DispatchSpawn(ent);
    TeleportEntity(ent, pos, ang, fwd);
    ActivateEntity(ent);
    PrintToChat(client, "[SM] Spawned a buggy");
    number++;
    }
    }else{
    PrintToChat(client, "[SM] Failed, maybe there are too many vehicles already.");
    }
    return Plugin_Handled;
    }
    */

    bool:adminCheck(client){
    if(GetConVarBool(sm_vehicle_adminonly)){
    new AdminId:admin = GetUserAdmin(client);
    if(!GetAdminFlag(admin, AdminFlag:Admin_Kick)){
    PrintToChat(client, "[SM] Sorry, only admins can spawn vehicles");
    return false;
    }
    }
    return true;
    }

    public OnMapStart(){
    number=0;
    }
    __________________
    GuitarSlayer
    daren adler is offline
    Send a message via MSN to daren adler
    Reply



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 13:11.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode