AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Is this used correctly? (https://forums.alliedmods.net/showthread.php?t=28011)

NewUser 05-05-2006 01:08

Is this used correctly?
 
I'm not exactly sure how to use this function in dodfun.

Function:
Quote:

Originally Posted by DoDFun
/* Gets player team name */
native dod_get_pl_teamname(index,szName[],len);

Here's my guess..

Code:
new axis[33]; new allies[33];     if(dod_get_pl_teamname(index, allies, 32); {     // stuff }

What I want to do is get which team they are on, and do stuff depending on which one they are on.

Xanimos 05-05-2006 01:10

Code:
new PlayerTeam[16] dod_get_pl_teamname( id , PlayerTeam , 15) if(equali(PlayerTeam , "allies")) {     //they are on allies }

[EDIT] I win.

v3x 05-05-2006 01:11

Code:
new tname[21]; dod_get_pl_teamname(id , tname , 20); if(equal(team , "allies")) {   // on the allies team }
Edit: zomg nice timing XD

NewUser 05-05-2006 01:46

Thanks, now, how would I use dod_get_pronestate?

Quote:

Originally Posted by dodx.inc
/* values are: 0-no prone, 1-prone, 2-prone + w_deploy */
native dod_get_pronestate(index);


v3x 05-05-2006 01:58

Quote:

0 (PS_NOPRONE): Not prone
1 (PS_PRONE): Prone
2 (PS_PRONEDEPLOY): Prone and weapon deployed
Quote:

Originally Posted by dodconst.inc
Code:
enum {     PS_NOPRONE =0,     PS_PRONE,     PS_PRONEDEPLOY,     PS_DEPLOY, }

Code:
new prone_state = dod_get_pronestate(id); if(prone_state == PS_PRONE) {   // prone }
etc.

NewUser 05-05-2006 14:06

Now, a little confused on this one.

Quote:

Originally Posted by inc file
/* Returns weapon name. */
native xmod_get_wpnname(wpnindex,name[],len);

Here's what I think, sort of.
Code:
new weapon[33]; xmod_get_wpnname(confusedhere,weapon,32); if(equali(weapon, "DODW_AMERKNIFE")) { // Has knife }

Xanimos 05-05-2006 14:22

it would be in the form of "weapon_<name here>"
for cs its "weapon_deagle" or something of the similar.

NewUser 05-05-2006 14:40

Quote:

Originally Posted by Suicid3
it would be in the form of "weapon_<name here>"
for cs its "weapon_deagle" or something of the similar.

May I ask for an example of how to use it the proper way?

Xanimos 05-05-2006 15:06

same way you did it but the string wont be "DODW_AMERKNIFE" it would be more like "weapon_amerknife". I don't know what it is because I don't program for DOD specifically.


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

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