Raised This Month: $246 Target: $400
 61% 

Showing results 1 to 25 of 500
Search took 0.02 seconds.
Search: Posts Made By: Black Rose
Forum: Scripting Help 05-13-2021, 03:58
Replies: 10
Views: 185
Posted By Black Rose
Re: getting data from get request not work

Even though that specific example doesn't work it's still relevant.



1. Download the zip for your server platform.
2. Unzip and place the binary in "cstrike\addons\amxmodx\modules".
3. Open...
Forum: Scripting Help 05-02-2021, 07:47
Replies: 2
Views: 254
Posted By Black Rose
Re: Hooking ScreenFade

If you're trying to hook screenfade sent by other plugins they need to send it using emessage_*()/ewrite_*() natives.


/* These are the same as above, except that the messages sent
* are also...
Forum: Scripting Help 04-25-2021, 15:39
Replies: 7
Views: 381
Posted By Black Rose
Re: How to pass tagged variable to other plugins

Tags doesn't actually do anything except makes the compiler capable of telling you that you might have used a variable in the wrong context. After compilation they're basically gone.
However, if you...
Forum: Scripting Help 04-20-2021, 13:33
Replies: 10
Views: 507
Posted By Black Rose
Re: How can I make NPCs avoid obstacles ?

There are design choices you can make along the way that will make the code more or less efficient.

The most important one is when is the pathing "out of date" and need to be updated?

Another...
Forum: Scripting Help 04-17-2021, 13:50
Replies: 10
Views: 507
Posted By Black Rose
Re: How can I make NPCs avoid obstacles ?

https://forums.alliedmods.net/showthread.php?t=242208

It needs work though. Generally the problem is the ground. I have been thinking to come back to this issue but never got around to it.

I...
Forum: Scripting Help 04-17-2021, 13:28
Replies: 2
Views: 182
Posted By Black Rose
Re: Help convert from engine to fakemete

Difference: 274 NANOSECONDS (that's 0.000 000 274s) per iteration.
Winner: Engine

Can we just kill this stupid idea now?


#include <amxmodx>
#include <engine>
#include <fakemeta>
#include...
Forum: Scripting Help 04-11-2021, 04:38
Replies: 3
Views: 221
Posted By Black Rose
Re: Max Player Armor

Not sure how you implemented it, this is what I intended:

public zp_extra_item_selected(player, itemid)
{
if ( itemid == g_itemid_armor && pev(player, pev_armorvalue) >= g_armor_limit )
{...
Forum: Scripting Help 04-10-2021, 18:02
Replies: 2
Views: 222
Posted By Black Rose
Re: Question about top15

You can't.
The end.
Forum: Scripting Help 04-10-2021, 17:59
Replies: 3
Views: 221
Posted By Black Rose
Re: Max Player Armor

You can use zp_extra_item_selected() to hook the purchase. Make your checks, for example:
if ( get_user_armor(id) + g_armor_amount > g_armor_limit ) // If you want to block buying at 101-200 armor....
Forum: Scripting Help 04-10-2021, 03:06
Replies: 6
Views: 277
Posted By Black Rose
Re: Increase cvar by a code

So debug it...

// Zombie killed human, add up the extra frags for kill
server_print("g_zombie[%d]: %d, pcvar(cvar_fragsinfect): %d", attacker, g_zombie[attacker],...
Forum: Scripting Help 04-06-2021, 12:20
Replies: 6
Solved write_bye
Views: 319
Posted By Black Rose
Re: write_bye

If the timing is wrong the game will overwrite your data unless you block the original message (assuming it's possible, I'm shit at the engine).

If you hook the event with a little console print...
Forum: Scripting Help 04-04-2021, 11:26
Replies: 2
Views: 241
Posted By Black Rose
Re: New message started when msg '23' has not been sent yet

message_begin(MSG_BROADCAST, SVC_TEMPENTITY); // Line 99
write_byte(TE_BLOODSPRITE);
engfunc(EngFunc_WriteCoord, Origin2[0])
engfunc(EngFunc_WriteCoord, Origin2[1])
...
Forum: Scripting Help 02-26-2021, 04:48
Replies: 9
Views: 662
Posted By Black Rose
Re: help me with this respawn plugin

Sorry. I missed this:

public fwd_HamKilled(id, Victim, Attacker, Shouldgib)

-->

public fwd_HamKilled(Victim, Attacker, Shouldgib) {
Forum: Scripting Help 02-22-2021, 11:24
Replies: 9
Views: 662
Posted By Black Rose
Re: help me with this respawn plugin

read_data() is not a function which is to be used with Ham_* forwards, only for messages hooked using register_event() (perhaps others, not entierly sure).

public fwd_HamKilled(id, Victim,...
Forum: Scripting Help 02-13-2021, 15:07
Replies: 2
Views: 172
Posted By Black Rose
Re: Server crashes Run time error 4: index out of bounds

Most likely missing a connected check or valid player range check on attacker. Probably the map that has the issues also has a way to suicide while the other might not.

Another possibility if your...
Forum: Scripting Help 02-13-2021, 14:43
Replies: 9
Views: 662
Posted By Black Rose
Re: help me with this respawn plugin

This is what I use on my server.
Doesn't detect spectator change, you'll have to add that separately.

#include <amxmodx>
#include <hamsandwich>

public plugin_init()
{...
Forum: Scripting Help 02-12-2021, 14:14
Replies: 12
Views: 402
Posted By Black Rose
Re: Need help with optimization

It all depends on how often it is called.

In your case I'd say your code is fine. but !x_arg[0] or strlen(x_arg) is a good compliment.


*cough* +1
Forum: Scripting Help 02-12-2021, 02:09
Replies: 3
Views: 162
Posted By Black Rose
Re: Compiling error

Just to be clear.

condition1 ? (yes1)condition2 ? yes2 : no2 : no1 //good
condition1 ? yes1 : (no1)condition2 ? yes2 : no2 //good
Forum: Scripting Help 02-01-2021, 11:23
Replies: 16
Solved if problem
Views: 615
Posted By Black Rose
Re: if problem

Any of these are correct:

if ( Restarted < 2 )
{
Restarted++; // Increased AFTER comparison
}


if ( ++Restarted <= 2 ) // Increased BEFORE comparison
{
Forum: Scripting Help 01-25-2021, 13:04
Replies: 6
Solved sql in amx ?
Views: 511
Posted By Black Rose
Re: sql in amx ?

You're gonna kick yourself.


@@ if(SQL_Connection != Empty_Handle) client_print(0,print_chat,"%s",error)
else sql_select(id)

->

@@ if(SQL_Connection == Empty_Handle)...
Forum: Scripting Help 01-24-2021, 15:28
Replies: 5
Views: 370
Posted By Black Rose
Re: How to learn amxx scripting?

Similar or not doesn't really matter. You will always have easier to learn if you know another programming language because you understand a lot of the basics already and can see patterns by looking...
Forum: Scripting Help 01-23-2021, 10:05
Replies: 8
Views: 452
Posted By Black Rose
Re: hook player id

So yeah. So you have a couple of options.

If we take this code here:

if ( cs_get_user_team(id) == CS_TEAM_T ){
switch(checkT[id]){
case 1:{
cs_set_user_model(id, "isis")...
Forum: Off-Topic 01-23-2021, 08:35
Replies: 5
Views: 1,652
Posted By Black Rose
Re: forum bbcode suggestions

No problem. I love doing stuff with JavaScript.

I had a tug of war with the automatic forum security over onclick event in the code which I eventually won.
Now also contains copy button.
Forum: Scripting Help 01-23-2021, 05:40
Replies: 8
Views: 452
Posted By Black Rose
Re: hook player id

In a not so far distant future.
One (wo)man on a quest for answers.
Little did (s)he know how it all would end...



Suddenly, a helpful character emerges from the darkness...

Helpful...
Forum: Off-Topic 01-22-2021, 20:01
Replies: 5
Views: 1,652
Posted By Black Rose
Re: forum bbcode suggestions

https://chrome.google.com/webstore/detail/custom-javascript-for-web/poakhlngfciodnhlhhgnaaelnpjljija (or something similar)

Nothing fancy.
It doesn't add line numbers to edits or new posts, only...
Showing results 1 to 25 of 500

 
Forum Jump

All times are GMT -4. The time now is 16:13.


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