Raised This Month: $51 Target: $400
 12% 

How to write a simple script for god mode?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ibanezez
SourceMod Donor
Join Date: Aug 2014
Location: Earth
Old 11-23-2014 , 21:43   How to write a simple script for god mode?
Reply With Quote #1

I'm trying to figure out how to write a very simple and short script on godmode. I want all players on my server to be in godmode from the time they join to the time they leave.

I know there are other plugins that already do this, but they have features that I don't need, so I want to make it as simple as possible.



How could I write something like this?
__________________
Hello
Ibanezez is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 11-23-2014 , 23:33   Re: How to write a simple script for god mode?
Reply With Quote #2

Take a look at those existing plugins.
__________________
ddhoward is offline
DJ Data
SourceMod Donor
Join Date: Dec 2012
Location: Switzerland
Old 11-24-2014 , 02:18   Re: How to write a simple script for god mode?
Reply With Quote #3

Code:
#include <sourcemod> public Plugin:myinfo = {     name = "God on Spawn",     author = "Danian",     description = "Gives you god mode on spawn",     version = "1.0",     url = "http://www.esrc.tv" }; public OnPluginStart() {     //Hooks     HookEvent("player_spawn", Event_PlayerSpawn); } public Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast) {     new client = GetClientOfUserId(GetEventInt(event, "userid"));         SetEntProp(client, Prop_Data, "m_takedamage", 0, 1); }
Attached Files
File Type: sp Get Plugin or Get Source (god_onspawn.sp - 380 views - 504 Bytes)
__________________
SourcePawn Coding Level: Novice

Last edited by Seta00; 11-26-2014 at 10:06. Reason: Removed binary, attached source
DJ Data is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 11-25-2014 , 10:29   Re: How to write a simple script for god mode?
Reply With Quote #4

Quote:
Originally Posted by DJ Data View Post
Code:
#include <sourcemod> public Plugin:myinfo = {     name = "God on Spawn",     author = "Danian",     description = "Gives you god mode on spawn",     version = "1.0",     url = "http://www.esrc.tv" }; public OnPluginStart() {     //Hooks     HookEvent("player_spawn", Event_PlayerSpawn); } public Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast) {     new client = GetClientOfUserId(GetEventInt(event, "userid"));         SetEntProp(client, Prop_Data, "m_takedamage", 0, 1); }
You know you don't need to attach an SMX if your ownly using includes that COME with SourceMod ITSELF. Just attach the sp file and let users click: Get Plugin
__________________
WildCard65 is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 11-26-2014 , 10:07   Re: How to write a simple script for god mode?
Reply With Quote #5

I removed the binary and attached the source file.
Seta00 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 21:24.


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