Tutoriale scripting, cod si portiuni de cod.
Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com
-
LondoN eXtream
- Membru eXtream
- Posts: 2755
- Joined: 10 Oct 2014, 06:21
- Detinator Steam: Da
- SteamID: /id/london_extreamcs
- Reputatie: Fost scripter eXtreamCS
Fost moderator ajutator
Membru Club eXtreamCS (6 luni)
- Fond eXtream: 0
- Location: Roman, Neamț
- Has thanked: 3 times
- Been thanked: 12 times
28 Feb 2016, 12:09
din ce librarie / modul face parte functia, ca am in pluginul de baza si nu imi porneste (uses an unknown function `write_coord_f`)
-
Nubo
- Fost moderator
- Posts: 2734
- Joined: 11 Jul 2012, 18:45
- Detinator Steam: Da
- CS Status: [əˈnɒn.ɪ.məs]
- Reputatie: Fost scripter eXtreamCS
Fost eXtream Mod
- Has thanked: 8 times
- Been thanked: 27 times
28 Feb 2016, 16:01
Default se afla in messages.inc (
https://www.amxmodx.org/api/messages/write_coord_f)
Dar se foloseste ca macro:
Code: Select all
#define write_coord_f(%0) ( engfunc( EngFunc_WriteCoord, %0 ) )
Acest macro necesita fakemeta.
Cand nu merge acest forum sunt online aici:
- * Skype: nubo_cs
* Y!M ID: nubo_cs
-
LondoN eXtream
- Membru eXtream
- Posts: 2755
- Joined: 10 Oct 2014, 06:21
- Detinator Steam: Da
- SteamID: /id/london_extreamcs
- Reputatie: Fost scripter eXtreamCS
Fost moderator ajutator
Membru Club eXtreamCS (6 luni)
- Fond eXtream: 0
- Location: Roman, Neamț
- Has thanked: 3 times
- Been thanked: 12 times
28 Feb 2016, 18:43
- | Afiseaza codul
write_coord_f(OriginF[0]);
write_coord_f(OriginF[1]);
write_coord_f(OriginF[2]);
Am inlocuit cu
- | Afiseaza codul
engfunc ( EngFunc_WriteCoord, OriginF [ 0 ] );
engfunc ( EngFunc_WriteCoord, OriginF [ 1 ] );
engfunc ( EngFunc_WriteCoord, OriginF [ 2 ] );
si cand folosesc grenada [aceasta functie o am in ham_think, grenada smoke] ma da afara de pe server si imi zice
- | Afiseaza codul
Host_Error: Bad Server Message
-
Nubo
- Fost moderator
- Posts: 2734
- Joined: 11 Jul 2012, 18:45
- Detinator Steam: Da
- CS Status: [əˈnɒn.ɪ.məs]
- Reputatie: Fost scripter eXtreamCS
Fost eXtream Mod
- Has thanked: 8 times
- Been thanked: 27 times
28 Feb 2016, 19:51
Nu creezi corect mesajul.
Poate te ajuta:
- | Afiseaza codul
message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
write_byte(TE_SPRITE);
engfunc(EngFunc_WriteCoord, origin[0]);
engfunc(EngFunc_WriteCoord, origin[1]);
engfunc(EngFunc_WriteCoord, origin[2]);
write_short(smoke_sid);
write_byte(50);
write_byte(115);
message_end();
Cand nu merge acest forum sunt online aici:
- * Skype: nubo_cs
* Y!M ID: nubo_cs
-
LondoN eXtream
- Membru eXtream
- Posts: 2755
- Joined: 10 Oct 2014, 06:21
- Detinator Steam: Da
- SteamID: /id/london_extreamcs
- Reputatie: Fost scripter eXtreamCS
Fost moderator ajutator
Membru Club eXtreamCS (6 luni)
- Fond eXtream: 0
- Location: Roman, Neamț
- Has thanked: 3 times
- Been thanked: 12 times
28 Feb 2016, 19:55
- | Afiseaza codul
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_EXPLOSION)
engfunc(EngFunc_WriteCoord, originF[0])
engfunc(EngFunc_WriteCoord, originF[1])
engfunc(EngFunc_WriteCoord, originF[2] + random_float(15.0, 25.0))
write_short(g_zexplo)
write_byte(15)
write_byte(0)
write_byte(TE_EXPLFLAG_NONE)
message_end()
in loc de engfunc era cu write_coord.
Toata functia explosive_explode
- explosive_explode(ent) | Afiseaza codul
// Flare Lighting Effects
explosive_explode(ent)
{
// Get origin
static Float:originF[3], victim, Float:dmg, Float:HP
pev(ent, pev_origin, originF)
// Make the explosion
create_blast4(originF)
// Collisions
victim = -1
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_EXPLOSION)
engfunc(EngFunc_WriteCoord, originF[0])
engfunc(EngFunc_WriteCoord, originF[1])
engfunc(EngFunc_WriteCoord, originF[2] + random_float(15.0, 25.0))
write_short(g_zexplo)
write_byte(15)
write_byte(0)
write_byte(TE_EXPLFLAG_NONE)
message_end()
new owner = pev(ent, pev_owner);
while ((victim = engfunc(EngFunc_FindEntityInSphere, victim, originF, NADE_EXPLOSION_RADIUS)) != 0)
{
// Only effect alive unfrozen zombies
if (!is_user_valid_alive(victim) || !g_zombie[victim] || get_user_godmode(victim) || g_nodamage[victim] || (g_frozen[victim] && !get_pcvar_num(cvar_damagewhilefrost)))
continue;
// Add a blue tint to their screen
message_begin(MSG_ONE, g_msgScreenFade, _, victim)
write_short(0) // duration
write_short(0) // hold time
write_short(FFADE_STAYOUT) // fade type
write_byte(220) // red
write_byte(0) // green
write_byte(0) // blue
write_byte(100) // alpha
message_end()
if (is_user_connected(owner))
{
dmg = 920.0 - entity_range(owner, victim);
if (dmg > 0.0)
{
HP=entity_get_float(victim,EV_FL_health);
if (HP-dmg > 0.0)
ExecuteHamB(Ham_TakeDamage, victim, ent, owner, dmg, DMG_MORTAR)
else
ExecuteHamB(Ham_Killed, victim, owner, 2)
}
}
}
// Get rid of the grenade
engfunc(EngFunc_RemoveEntity, ent)
}
- create_blast4 | Afiseaza codul
create_blast4(const Float:originF[3])
{
// Smallest ring
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
write_byte(TE_BEAMCYLINDER) // TE id
engfunc(EngFunc_WriteCoord, originF[0]) // x
engfunc(EngFunc_WriteCoord, originF[1]) // y
engfunc(EngFunc_WriteCoord, originF[2]) // z
engfunc(EngFunc_WriteCoord, originF[0]) // x axis
engfunc(EngFunc_WriteCoord, originF[1]) // y axis
engfunc(EngFunc_WriteCoord, originF[2]+385.0) // z axis
write_short(g_exploSpr) // sprite
write_byte(0) // startframe
write_byte(0) // framerate
write_byte(4) // life
write_byte(60) // width
write_byte(0) // noise
write_byte(255) // red
write_byte(0) // green
write_byte(0) // blue
write_byte(200) // brightness
write_byte(0) // speed
message_end()
// Medium ring
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
write_byte(TE_BEAMCYLINDER) // TE id
engfunc(EngFunc_WriteCoord, originF[0]) // x
engfunc(EngFunc_WriteCoord, originF[1]) // y
engfunc(EngFunc_WriteCoord, originF[2]) // z
engfunc(EngFunc_WriteCoord, originF[0]) // x axis
engfunc(EngFunc_WriteCoord, originF[1]) // y axis
engfunc(EngFunc_WriteCoord, originF[2]+470.0) // z axis
write_short(g_exploSpr) // sprite
write_byte(0) // startframe
write_byte(0) // framerate
write_byte(4) // life
write_byte(60) // width
write_byte(0) // noise
write_byte(255) // red
write_byte(0) // green
write_byte(0) // blue
write_byte(200) // brightness
write_byte(0) // speed
message_end()
// Largest ring
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
write_byte(TE_BEAMCYLINDER) // TE id
engfunc(EngFunc_WriteCoord, originF[0]) // x
engfunc(EngFunc_WriteCoord, originF[1]) // y
engfunc(EngFunc_WriteCoord, originF[2]) // z
engfunc(EngFunc_WriteCoord, originF[0]) // x axis
engfunc(EngFunc_WriteCoord, originF[1]) // y axis
engfunc(EngFunc_WriteCoord, originF[2]+555.0) // z axis
write_short(g_exploSpr) // sprite
write_byte(0) // startframe
write_byte(0) // framerate
write_byte(4) // life
write_byte(60) // width
write_byte(0) // noise
write_byte(255) // red
write_byte(0) // green
write_byte(0) // blue
write_byte(200) // brightness
write_byte(0) // speed
message_end()
}
Oare m-ar ajuta la ceva
- | Afiseaza codul
new Origin[3];
FVecIVec(OriginF, Origin);
-
Nubo
- Fost moderator
- Posts: 2734
- Joined: 11 Jul 2012, 18:45
- Detinator Steam: Da
- CS Status: [əˈnɒn.ɪ.məs]
- Reputatie: Fost scripter eXtreamCS
Fost eXtream Mod
- Has thanked: 8 times
- Been thanked: 27 times
28 Feb 2016, 20:18
Exemplu din "Behemoth Grenade":
- | Afiseaza codul
static TE_FLAG
TE_FLAG |= 4
TE_FLAG |= 8
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_EXPLOSION)
engfunc(EngFunc_WriteCoord, originF[0])
engfunc(EngFunc_WriteCoord, originF[1])
engfunc(EngFunc_WriteCoord, originF[2]+30)
write_short(sExplo)
write_byte(50)
write_byte(30)
write_byte(TE_FLAG)
message_end()
Cand nu merge acest forum sunt online aici:
- * Skype: nubo_cs
* Y!M ID: nubo_cs
-
Users browsing this forum: No registered users and 18 guests