AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Argument type mismatch (https://forums.alliedmods.net/showthread.php?t=11558)

burcyril10 03-23-2005 02:17

Argument type mismatch
 
Code:
register_cvar("amx_superjump",0) register_cvar("amx_kungfu",0)
huh? what ? it complains about argument two. I don't want to put it in quotes cause its not a string, I just want to get it using get_cvar_num("amx_superjump")

Jinto 03-23-2005 02:42

Put it in quotes doesn't matter if its not a string. get_cvar_num will return a number.

burcyril10 03-24-2005 19:18

see, thats the problem, it would see that get_cvar_num() is NOT returning the correct number...

burcyril10 03-24-2005 19:39

Ok did more debuging the number is correct, it does get the correct number BUT this doesn't work
Code:
powerup = ts_createpwup(TSPWUP_SUPERJUMP) ts_givepwup(id,powerup) client_print(id,print_chat,"[AMXX]Received free powerup")
All that i see is "[AMXX]Received free powerup" in chat so it os obviously going there but i never acualy get the powerup....yes, id = client

Twilight Suzuka 03-24-2005 21:07

Did you check to make sure it spawned the powerup?

XxAvalanchexX 03-24-2005 23:28

Quote:

Originally Posted by amxmodx-source-1.0\dlls\ts\tsx\NBase.cpp
// create_pwup -> !wait! -> give_pwup


burcyril10 03-25-2005 00:49

Ok, you two lost me....what ?!? I have no idea about what i mean 'spawning the powerup' all i know is that the target client never gets it.

What on earth does avalanches post mean?

burcyril10 03-25-2005 20:08

*bump* I still don't have a clue...only been coding with amx for about 2 weeks, give me a break....

XxAvalanchexX 03-26-2005 01:39

Let's translate:

// create_pwup -> !wait! -> give_pwup

This means:

Create the powerup then WAIT then give the powerup.

Use a set_task of 0.1 or so after creating it before you give it.

Code:
public wooh(id) {    new powerup = ts_createpwup(TSPWUP_SUPERJUMP)    new parms[2];    parms[0] = id;    parms[1] = powerup;    set_task(0.1,"give_the_pwup",id,parms,2); } public give_the_pwup(parms[]) {    ts_givepwup(parms[0],parms[1])    client_print(parms[0],print_chat,"[AMXX]Received free powerup") }


All times are GMT -4. The time now is 09:52.

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