Witam, posiadam taki problem, że zrobiłem sobie do nowego Cmoda klasę wsparcie ogniowe, ale podczas kompilacji wyskakuje mi błąd 017 dotyczący funkcji GetINT.
Spoiler
#include <sourcemod>
#include <sdkhooks>
#include <sdktools>
#include <cmod>
new ilosc_rakiet_gracza[MAXPLAYERS+1];
public Plugin:myinfo =
{
name = "Klasa Wsparcie Ogniowe",
author = "PLX",
description = "Klasa Wsparcie Ogniowe",
version = "0.1",
url = "xxx"
}
;
public OnPluginStart()
{
new Handle:weapons = CreateArray(32);
PushArrayString(weapons, "weapon_mp7");
Cmod_RegisterClass("Wsparcie Ogniowe", "Posiada MP7 oraz 3 rakiety co runde", 10, 0, 10, 10, weapons);
PrecacheSound("weapons/hegrenade/explode5.wav");
PrecacheModel("models/props/de_vertigo/construction_safetyribbon_01.mdl");
}
public Cmod_OnClassEnabled(client, ClassID:id)
{
ilosc_rakiet_gracza[client] = 3;
}
public Cmod_OnClassDisabled(client, ClassID:id)
{
ilosc_rakiet_gracza[client] = 0;
}
public Cmod_OnClientUseSkill(client, ClassID:id)
{
StworzRakiete(client)
}
public EventPlayerSpawn(client)
{
ilosc_rakiet_gracza[client] = 3;
}
public Action:StworzRakiete(client)
{
if(ilosc_rakiet_gracza[client])
{
new ent = CreateEntityByName("hegrenade_projectile");
if(ent == -1)
return;
new Float:OwnerAng[3];
new Float:OwnerPos[3];
new Float:InitialPos[3];
new Float:InitialVec[3];
new Float:InitialAng[3];
SetEntPropEnt(ent, Prop_Send, "m_hOwnerEntity", client);
GetClientEyeAngles(client, OwnerAng);
GetClientEyePosition(client, OwnerPos);
TR_TraceRayFilter(OwnerPos, OwnerAng, MASK_SOLID, RayType_Infinite, WybuchEnta, ent);
TR_GetEndPosition(InitialPos);
MakeVectorFromPoints(OwnerPos, InitialPos, InitialVec);
NormalizeVector(InitialVec, InitialVec);
ScaleVector(InitialVec, 1000.0);
GetVectorAngles(InitialVec, InitialAng);
DispatchSpawn(ent);
ActivateEntity(ent);
SetEntityModel(ent, "models/props/de_vertigo/construction_safetyribbon_01.mdl");
SetEntityMoveType(ent, MOVETYPE_FLY);
TeleportEntity(ent, OwnerPos, InitialAng, InitialVec);
SDKHook(ent, SDKHook_StartTouchPost, DotykRakiety);
ilosc_rakiet_gracza[client]--;
}
}
public Action:DotykRakiety(ent, other)
{
if(GetEntProp(other, Prop_Data, "m_nSolidType") && !(GetEntProp(other, Prop_Data, "m_usSolidFlags") & 0x0004))
{
new MissileOwner = GetEntPropEnt(ent, Prop_Send, "m_hOwnerEntity");
if(IsClientInGame(MissileOwner))
{
new Float:MissilePos[3];
new MissileOwnerTeam = GetEntProp(MissileOwner, Prop_Send, "m_iTeamNum");
new ExplosionIndex = CreateEntityByName("env_explosion");
GetEntPropVector(ent, Prop_Send, "m_vecOrigin", MissilePos);
SetEntProp(ent, Prop_Send, "m_iTeamNum", MissileOwnerTeam);
DispatchKeyValue(ExplosionIndex,"classname","hegrenade_projectile");
SetEntProp(ExplosionIndex, Prop_Data, "m_spawnflags", 6146);
SetEntProp(ExplosionIndex, Prop_Data, "m_iMagnitude", 40+GetINT(MissileOwner)/6);
SetEntProp(ExplosionIndex, Prop_Data, "m_iRadiusOverride", 200);
DispatchSpawn(ExplosionIndex);
ActivateEntity(ExplosionIndex);
TeleportEntity(ExplosionIndex, MissilePos, NULL_VECTOR, NULL_VECTOR);
SetEntPropEnt(ExplosionIndex, Prop_Send, "m_hOwnerEntity", MissileOwner);
SetEntProp(ExplosionIndex, Prop_Send, "m_iTeamNum", MissileOwnerTeam);
EmitSoundToAll("weapons/hegrenade/explode5.wav", ExplosionIndex, 1, 90);
AcceptEntityInput(ExplosionIndex, "Explode");
DispatchKeyValue(ExplosionIndex,"classname","env_explosion");
AcceptEntityInput(ExplosionIndex, "Kill");
AcceptEntityInput(ent, "Kill");
}
else
AcceptEntityInput(ent, "Kill");
}
}
public bool:WybuchEnta(ent, contentsMask, any:data)
{
return false;
}
Użytkownik BartekB edytował ten post 21.11.2015 11:18