forked from ugurbayraktarr/Plugins-for-CSGO-Servers
-
Notifications
You must be signed in to change notification settings - Fork 3
/
crashFix.sp
35 lines (31 loc) · 871 Bytes
/
crashFix.sp
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
#include <sdktools>
#include <cstrike>
#include <datapack>
#pragma semicolon 1
public Plugin:myinfo =
{
name = "Crash Fix",
author = "ImPossibLe`",
description = "DrK # GaminG",
version = "1.0"
}
public Action CS_OnCSWeaponDrop(int client, int weaponIndex){
float pos[3];
GetClientAbsOrigin(client, pos);
DataPack dp_info = new DataPack();
dp_info.WriteCell(weaponIndex);
dp_info.WriteFloat(pos[0]);
dp_info.WriteFloat(pos[1]);
dp_info.WriteFloat(pos[2]);
CreateTimer(0.0, teleport_weapon, dp_info);
}
public Action teleport_weapon(Handle timer, DataPack dp_info){
dp_info.Reset();
float pos[3];
int weaponIndex;
weaponIndex = dp_info.ReadCell();
pos[0] = dp_info.ReadFloat();
pos[1] = dp_info.ReadFloat();
pos[2] = dp_info.ReadFloat();
TeleportEntity(weaponIndex, pos, NULL_VECTOR, NULL_VECTOR);
}