You are not logged in.

Dear visitor, welcome to sourceserver.info. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Gesetz-des-Zorns

Intermediate

  • "Gesetz-des-Zorns" started this thread

Posts: 417

Location: 127.0.0.1

wcf.user.option.userOption53: Ja

  • Send private message

1

Monday, March 10th 2014, 4:28pm

Give Weapon Plugin umschreiben

Hi @ all,

Ich wollte mal fragen ob mir jemand dieses Plugin umschreiben könnte [CS:GO] Give Weapon ?
Wie folgt :

Und zwar möchte ich das man den kompletten Team, eine M4A4 usw. geben kann (@T ; @CT ; @all).
Vllt. findet sich ja jemand der so nett ist und es machen könnte. :)
Das Zauberwort "Bitte" habe ich vergessen :bestteam:

Ich hänge mal den Sourcecode an ^^

Spoiler Spoiler


PHP Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#include <sourcemod>
#include <sdktools>

#pragma semicolon 1

#define MAX_WEAPONS        39

public Plugin:myinfo = {
    name "Give Weapon",
    author "Kiske",
    description "Give a weapon to a player from a command",
    version "1.0.1",
    url "http://www.sourcemod.net/"
};

new const String:g_weapons[MAX_WEAPONS][] = {
    "weapon_ak47""weapon_aug""weapon_bizon""weapon_cz75a""weapon_deagle""weapon_decoy""weapon_elite""weapon_famas""weapon_fiveseven""weapon_flashbang",
    "weapon_g3sg1""weapon_galilar""weapon_glock""weapon_hegrenade""weapon_hkp2000""weapon_incgrenade""weapon_knife""weapon_m249""weapon_m4a1",
    "weapon_m4a1_silencer""weapon_mac10""weapon_mag7""weapon_molotov""weapon_mp7""weapon_mp9""weapon_negev""weapon_nova""weapon_p250""weapon_p90",
    "weapon_sawedoff""weapon_scar20""weapon_sg556""weapon_smokegrenade""weapon_ssg08""weapon_taser""weapon_tec9""weapon_ump45""weapon_usp_silencer",
    "weapon_xm1014"
};

public OnPluginStart()
{
    RegAdminCmd("sm_weapon"smWeaponADMFLAG_BAN"- <target> <weaponname>");
    RegAdminCmd("sm_weaponlist"smWeaponListADMFLAG_BAN"- list of the weapon names");
}

public Action:smWeapon(idargs)
{
    if(args 2)
    {
        ReplyToCommand(id"[SM] Usage: sm_weapon <name | #userid> <weaponname>");
        return Plugin_Handled;
    }
    
    decl String:sArg[256];
    decl String:sTempArg[32];
    decl String:sWeaponName[32];
    decl String:sWeaponNameTemp[32];
    decl iL;
    decl iNL;
    
    GetCmdArgString(sArgsizeof(sArg));
    iL BreakString(sArgsTempArgsizeof(sTempArg));
    
    if((iNL BreakString(sArg[iL], sWeaponNamesizeof(sWeaponName))) != -1)
        iL += iNL;
    
    new i;
    new iValid 0;
    
    if(StrContains(sWeaponName"weapon_") == -1)
    {
        FormatEx(sWeaponNameTemp31"weapon_");
        StrCat(sWeaponNameTemp31sWeaponName);
        
        strcopy(sWeaponName31sWeaponNameTemp);
    }
    
    for(0MAX_WEAPONS; ++i)
    {
        if(StrEqual(sWeaponNameg_weapons[i]))
        {
            iValid 1;
            break;
        }
    }
    
    if(!iValid)
    {
        ReplyToCommand(id"[SM] The weaponname (%s) isn't valid"sWeaponName);
        return Plugin_Handled;
    }
    
    decl String:sTargetName[MAX_TARGET_LENGTH];
    decl sTargetList[1];
    decl bool:bTN_IsML;
    
    new iTarget = -1;
    
    if(ProcessTargetString(sTempArgidsTargetList1COMMAND_FILTER_ALIVE|COMMAND_FILTER_NO_MULTIsTargetNamesizeof(sTargetName), bTN_IsML) > 0)
        iTarget sTargetList[0];
    
    if(iTarget != -&& !IsFakeClient(iTarget))
        GivePlayerItem(iTargetsWeaponName);
    
    return Plugin_Handled;
}

public Action:smWeaponList(idargs)
{
    new i;
    for(0MAX_WEAPONS; ++i)
        ReplyToCommand(id"%s"g_weapons[i]);
    
    ReplyToCommand(id"");
    ReplyToCommand(id"* No need to put weapon_ in the <weaponname>");
    
    return Plugin_Handled;
}



MFG
Gesetz-des-Zorns
Rechtschreibfehler sind voll normal und passieren nunmal 8)
Ich gebe keine Antworten auf PN, dazu ist das komplette Forum da um Anfragen zu beantworten ...