Raised This Month: $32 Target: $400
 8% 

[l4d2]My first time modifyng or making a plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
gamemann
Veteran Member
Join Date: Sep 2009
Location: Mullica Hill, New Jersey
Old 11-30-2009 , 22:54   [l4d2]My first time modifyng or making a plugin
Reply With Quote #1

I am going to modify a plugin or make a first plugin that when a survivor dies such as coach or nick they can come back alive in like 45 seconds but i'm not sure yet because i am still learning the basics in plugins programing so if anyone has advice to make a plugin please post it in here also if there is already a plugin that will consider l4d2 please post it and i will decide to make a new on
Edit:
Also i am new to plugin because i am just learning them today so can somebody please give me a website or their advice of plugins (if you make them or know how to) i need to also know how to make them load a config and making your own cvars i know you start out with { and end with } but please just help (it's ok if you don't) i just want to be a plugin pro like plugin "infectedbots" and "superversus" and all i host a l4d2 server. So i want to know how to make plugins.

Last edited by gamemann; 11-30-2009 at 23:04.
gamemann is offline
Send a message via Skype™ to gamemann
Bigbuck
Senior Member
Join Date: Jul 2009
Old 11-30-2009 , 23:16   Re: [l4d2]My first time modifyng or making a plugin
Reply With Quote #2

These will help get you on the right track:

http://wiki.alliedmods.net/Category:SourceMod_Scripting
http://docs.sourcemod.net/api/
Bigbuck is offline
gamemann
Veteran Member
Join Date: Sep 2009
Location: Mullica Hill, New Jersey
Old 12-01-2009 , 15:04   Re: [l4d2]My first time modifyng or making a plugin
Reply With Quote #3

Quote:
Originally Posted by Bigbuck View Post
Thanks so much i am understanding it now. Still looking for how to make configs load though.
gamemann is offline
Send a message via Skype™ to gamemann
gamemann
Veteran Member
Join Date: Sep 2009
Location: Mullica Hill, New Jersey
Old 12-01-2009 , 15:10   Re: [l4d2]My first time modifyng or making a plugin
Reply With Quote #4

Also i am following along to make a plugin now!
gamemann is offline
Send a message via Skype™ to gamemann
gamemann
Veteran Member
Join Date: Sep 2009
Location: Mullica Hill, New Jersey
Old 12-01-2009 , 15:54   Re: [l4d2]My first time modifyng or making a plugin
Reply With Quote #5

Now since i am new can somebody help me with getting this plugin to work. And make it. Get the Attachment and that will show what i have so far but i am trying to create cvars for the plugin but remember the plugin is about when a survivor dies it shows a timer and when that time is up and they're not alive in a rescue closet yet it automanicly spawns them at spawn.
Attached Files
File Type: sp Get Plugin or Get Source (respawner_survivor.sp - 123 views - 1.0 KB)
gamemann is offline
Send a message via Skype™ to gamemann
Bigbuck
Senior Member
Join Date: Jul 2009
Old 12-01-2009 , 15:55   Re: [l4d2]My first time modifyng or making a plugin
Reply With Quote #6

If you are referring to a config for your plugin then you would do this. If the config exists it will load it, if it doesn't it will create it with the default values you set.

PHP Code:
// Load config
AutoExecConfig(true"l4d_zombie_apocalypse"); 
Bigbuck is offline
gamemann
Veteran Member
Join Date: Sep 2009
Location: Mullica Hill, New Jersey
Old 12-01-2009 , 19:48   Re: [l4d2]My first time modifyng or making a plugin
Reply With Quote #7

I need help making a plugin.
Edit:
Here's my script a little updated but i tried compiling it and came up with 13 errors (still my first plugin)??? SO please correct it and maybe add to it and tell me and post the update on here to see what you guys did (opional). Here it is.
ALso i have an image to show you what i compile it and the errors say.
HEre that is:::
Attached Thumbnails
Click image for larger version

Name:	error_picture- 12-1-09.jpg
Views:	143
Size:	98.4 KB
ID:	54438  
Attached Files
File Type: sp Get Plugin or Get Source (respawner_survivor.sp - 94 views - 1.7 KB)

Last edited by gamemann; 12-01-2009 at 20:54.
gamemann is offline
Send a message via Skype™ to gamemann
Sillium
AlliedModders Donor
Join Date: Sep 2008
Location: Germany
Old 12-02-2009 , 01:07   Re: [l4d2]My first time modifyng or making a plugin
Reply With Quote #8

1. try to work with indentation it will make things easier to read

2. there is almost no ; in your file. You have to put a ; after every command. (of course not after if())

3. looks like your {} are wrong sometimes or missing completely

4. You can not just pu AutoExecConfig() anywhere. It has to be in a Function!

5. You're calling ProcessTargetString() in ProcessTargetString itself. This will be an never ending loop.

6. Misspelled clients

Try to look at other Plugins and maybe take one of them as an example to work by or try to just modify one in the first step to get an understanding how the structure is supposed to be and what functions you need and how they look like.

I tried to format the file and correct the {} and ; I did not try to compile the file but to give you an hint what I should look like I take a look at this
Code:
Public Action:customCMD_Respawn_survivor(client, Args)
{

    new String:arg1[32], new String:arg2[32], new String:arg3[70];
    new time;
    /* Get the first agument*/
    GetCmdArg(1, arg1, timeof(45));
    if(args>=2&&GetCmdArg(2,arg2,timeof(45))
    {
        time = stringtoint(arg2);
    }

    /* Finding a matching player*/
    new target = findtarget(cielent, arg);
    if(target == -1)
    {
    /* Findtarget) automatically replies with the 
    * failure reason.
    */
        return Plugin_Handle;
    }
    respawn_survivor(target, time)
    new string:name[max_spawn_time]

    GetCielentName(target, name, timeof(spawn))
    ReplyToCommand(cielent, "[SM} you have died but will spawn in (time)", name, time)
    LoadAction(cielent, target, "\"%time\" time \"time%\" (time %t)", cielent, target. damage)
    
    return Plugin_handle;
}
Formatting still could be better but I don't have the time right now :-)
__________________
brb, dishes have developed their own language and are talking to the garbage about overthrowing me... i must correct this

www.unterwasserpyromanen.de

Last edited by Sillium; 12-02-2009 at 01:11.
Sillium is offline
gamemann
Veteran Member
Join Date: Sep 2009
Location: Mullica Hill, New Jersey
Old 12-02-2009 , 14:58   Re: [l4d2]My first time modifyng or making a plugin
Reply With Quote #9

Quote:
Originally Posted by Sillium View Post
1. try to work with indentation it will make things easier to read

2. there is almost no ; in your file. You have to put a ; after every command. (of course not after if())

3. looks like your {} are wrong sometimes or missing completely

4. You can not just pu AutoExecConfig() anywhere. It has to be in a Function!

5. You're calling ProcessTargetString() in ProcessTargetString itself. This will be an never ending loop.

6. Misspelled clients

Try to look at other Plugins and maybe take one of them as an example to work by or try to just modify one in the first step to get an understanding how the structure is supposed to be and what functions you need and how they look like.

I tried to format the file and correct the {} and ; I did not try to compile the file but to give you an hint what I should look like I take a look at this
Code:
Public Action:customCMD_Respawn_survivor(client, Args)
{
 
    new String:arg1[32], new String:arg2[32], new String:arg3[70];
    new time;
    /* Get the first agument*/
    GetCmdArg(1, arg1, timeof(45));
    if(args>=2&&GetCmdArg(2,arg2,timeof(45))
    {
        time = stringtoint(arg2);
    }
 
    /* Finding a matching player*/
    new target = findtarget(cielent, arg);
    if(target == -1)
    {
    /* Findtarget) automatically replies with the 
    * failure reason.
    */
        return Plugin_Handle;
    }
    respawn_survivor(target, time)
    new string:name[max_spawn_time]
 
    GetCielentName(target, name, timeof(spawn))
    ReplyToCommand(cielent, "[SM} you have died but will spawn in (time)", name, time)
    LoadAction(cielent, target, "\"%time\" time \"time%\" (time %t)", cielent, target. damage)
 
    return Plugin_handle;
}
Formatting still could be better but I don't have the time right now :-)
Thanks but still this is my first plugin and ever plugin scripting i just need some help though, plus i do try to look at other plugins and modify it but then it compiles wrong.
gamemann is offline
Send a message via Skype™ to gamemann
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 12:53.


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