Raised This Month: $ Target: $400
 0% 

newbie confused


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
svendude
Member
Join Date: Aug 2004
Old 10-19-2004 , 07:19   newbie confused
Reply With Quote #1

ok i'm looking through all these easy scripts, and i see this thing

Code:
 {     if (!cmd_access(id,level,cid,2))     return PLUGIN_HANDLED     new arg[32]     read_argv(1,arg,31)     new player = cmd_target(id,arg,8)     if (!player) return PLUGIN_HANDLED     new authid[32],authid2[32],name2[32],name[32]     get_user_authid(id,authid,31)     get_user_authid(player,authid2,31)     get_user_name(player,name2,31)     get_user_name(id,name,31)     return PLUGIN_HANDLED }

but what i don't understand is what the

Code:
 new arg[32]     read_argv(1,arg,31)
means, anyone know?
svendude is offline
Send a message via Yahoo to svendude
MC-Olivenoel
Member
Join Date: Oct 2004
Old 10-19-2004 , 07:35  
Reply With Quote #2

hi

its n argument ...

example...

if u type in console

kick playerXYZ

Code:
new arg[32] 
      read_argv(1,arg,31)

first makes n variable ;)
2. read the argument of the command kick ;)

here its playerXYZ

read_argv(1,arg,31)

1 = nummer of argument ( kick <arg1> <arg2> <arg3>)
arg = the variable where to put in the argument (arg = playerXYZ)
31 = how long is the argument (if its longer it will cut)


hope its correckt

cucu
MC-Olivenoel is offline
svendude
Member
Join Date: Aug 2004
Old 10-19-2004 , 07:40  
Reply With Quote #3

ok but whats an arg?

whats the basic layout for a block of code? Sorry if im ticking anyone of with my noobish but it will soon past, once you learn, u can't learn again... sorta
svendude is offline
Send a message via Yahoo to svendude
svendude
Member
Join Date: Aug 2004
Old 10-19-2004 , 07:50  
Reply With Quote #4

Code:
#include <amxmodx> #include <amxmisc> #include <fun> public plugin_init(){     register_plugin("inviso","1.0","Carl/svendude")     register_concmd("amx_inviso","cmdinviso",ADMIN_BAN,"<name or #userid>")     return PLUGIN_continue } public cmdinviso(id, level, cid) {        if (!cmd_access(id,level,cid,2))        return PLUGIN_HANDLED

so far that's my whole plugin, but now im stuck, i don't know what to do from there. I know what the symtax is for what im doing but do i have to add any of that new arg [32] stuff?
svendude is offline
Send a message via Yahoo to svendude
MC-Olivenoel
Member
Join Date: Oct 2004
Old 10-19-2004 , 07:53  
Reply With Quote #5

put arg only if u want to use arguments to config the plugin at runtime ;)

like

pause 1
pause 0

there u need n argument ;)
MC-Olivenoel is offline
svendude
Member
Join Date: Aug 2004
Old 10-20-2004 , 03:53  
Reply With Quote #6

ok thx, now i started small, just an easy rendering script:

Code:
#include <amxmodx> #include <amxmisc> #include <fun> public plugin_init(){     register_plugin("inviso","1.0","Carl/svendude")     register_concmd("amx_inviso","cmdinviso",ADMIN_BAN,"<name or #userid>")     return PLUGIN_CONTINUE } public cmdinviso(id, level, cid) {        if (!cmd_access(id,level,cid,2))        return PLUGIN_HANDLED    set_user_rendering(index,kRenderTransTexture,255,0,0,kRenderNormal,25)    return PLUGIN_HANDLED }

now it says index is undefined, what does that mean? what slot i want it to be? what if i want it to be any slot?

ps: can you tell where my loose identity thingy is?
svendude is offline
Send a message via Yahoo to svendude
MC-Olivenoel
Member
Join Date: Oct 2004
Old 10-20-2004 , 04:27  
Reply With Quote #7

hi

this index bug is esey ;)

set_user_rendering(index,kRenderTransTexture, 255,0,0,kRenderNormal,25)

the index is wrong

u must put n nummer there

index = nummer of player 0 - 31

if u put "0" there its the 1. player on server
if u put "2" there its the 2. player on server

if u put "id" there its the player witch is using the command ;)

u must replace index with id then its fine
MC-Olivenoel is offline
breaddawson
Senior Member
Join Date: Jul 2004
Location: Beijing,China
Old 10-20-2004 , 08:44  
Reply With Quote #8

Quote:
if u put "2" there its the 2. player on server
maybe u want to say

if u put "1" there its the second player on server

i'm a newbie ,too
and i just want to know how the function worked u talked about
Code:
set_user_rendering(index,kRenderTransTexture,255,0,0,kRenderNormal,25)
yes, i saw the inc files
but i can't understand it

maybe when u use this,the player u specified will be looked in another color?
__________________
i'm bread dawson ,a chinese boy
wish u be happy~
breaddawson is offline
Send a message via ICQ to breaddawson Send a message via MSN to breaddawson
MC-Olivenoel
Member
Join Date: Oct 2004
Old 10-20-2004 , 08:55  
Reply With Quote #9

OOOooo ups

ok 1 is 2. player ... LOL

now i'v no time to explain set_user_rendering

cucu
MC-Olivenoel is offline
twistedeuphoria
Veteran Member
Join Date: Jul 2004
Old 10-20-2004 , 11:06  
Reply With Quote #10

Code:
#include <amxmodx> #include <amxmisc> #include <fun> public plugin_init(){ register_plugin("inviso","1.0","Carl/svendude") register_concmd("amx_inviso","cmdinviso",ADMIN_BAN,"<name or #userid>") return PLUGIN_CONTINUE } public cmdinviso(id, level, cid) { if (!cmd_access(id,level,cid,2)) return PLUGIN_HANDLED set_user_rendering(id,kRenderTransTexture,255,0,0,kRenderNormal,25) return PLUGIN_HANDLED }
Alright, what this is gonna do is make the person who uses the command invisible(I think, don't know kRenderTransTexture). What you want to do is get the target player and to do that add this:
Code:
      new target[32],tid //Declare the variables    read_args(target,31) //<<<< Since you only have one thing that changes in the command (the player) you can read the whole string.    tid = cmd_target(id,target,8)  // A very useful function...check out the function area on the front page for flags.    if(!tid)  //Check if the player is valid       return PLUGIN_HANDLED
So add that right after your return if they don't have enough access and change "id" in set_user_rendering to "tid" and it should work correctly.
__________________
twistedeuphoria is offline
Reply



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 17:15.


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