Raised This Month: $ Target: $400
 0% 

why this plugin make me crash ?


Post New Thread Reply   
 
Thread Tools Display Modes
delachambre
AlliedModders Donor
Join Date: Jan 2011
Location: France
Old 05-05-2014 , 08:10   Re: why this plugin make me crash ?
Reply With Quote #11

Quote:
Originally Posted by Miew View Post
PHP Code:
#include <sourcemod>
#include <sdktools>

new Float:f_PosClient[3];

new 
g_HaloIndex;
new 
g_ModelIndex;

public 
Plugin:myinfo =
{
    
name "Player_Jump_Effect",
    
author "Skuzy",
    
description " ",
    
version "1.0.0",
    
url " "
};

public 
OnPluginStart()
{
    
HookEvent("player_jump"OnPlayerJump_CB);

    
g_HaloIndex PrecacheModel("materials/sprites/halo01.vmt");
    
g_ModelIndex PrecacheModel("sprites/laser.vmt");

}

public 
OnPlayerJump_CB(Handle:event, const String:name[], bool:dontBroadcast

    new 
userid GetEventInt(event"userid"); 
    new 
client GetClientOfUserId(userid);
        
Beam(client);


public 
Beam(client)
{
    
GetClientAbsOrigin(clientf_PosClient);

    
f_PosClient[2] += 5;
    new 
color[4];
    
color[0] = GetRandomInt(0255);
    
color[1] = GetRandomInt(0255);
    
color[2] = GetRandomInt(0255);
    
color[3] = 255;

    
TE_SetupBeamRingPoint(f_PosClient40.050.0g_ModelIndexg_HaloIndex0100.610.00.5color101);
    
TE_SendToAll();

Lowl

And, if client index is bad ? WHATS HAPPENING
__________________
♥ 𝕊ℙ𝕒𝕨𝕟 𝔻𝕖𝕧𝕖𝕝𝕠𝕡𝕖𝕣 [ℂ𝕊:𝕊] ♥

Clan-Nemesis
delachambre is offline
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 05-05-2014 , 08:12   Re: why this plugin make me crash ?
Reply With Quote #12

Quote:
Originally Posted by delachambre View Post
Lowl

And, if client index is bad ? WHATS HAPPENING
Probatly plugin would stop and error out at: GetClientAbsOrigin(client, f_PosClient);
Thought i doubt it will error out since
player_jump is event and events shouldn't provide invalid data

Unless player_jump event would be fired & created manually by client in some half-assed plugin
__________________
...

Last edited by Oshizu; 05-05-2014 at 08:21.
Oshizu is offline
Reply


Thread Tools
Display Modes

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 12:54.


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