AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   How to write a simple script for god mode? (https://forums.alliedmods.net/showthread.php?t=252022)

Ibanezez 11-23-2014 21:43

How to write a simple script for god mode?
 
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?

ddhoward 11-23-2014 23:33

Re: How to write a simple script for god mode?
 
Take a look at those existing plugins.

DJ Data 11-24-2014 02:18

Re: How to write a simple script for god mode?
 
1 Attachment(s)
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); }

WildCard65 11-25-2014 10:29

Re: How to write a simple script for god mode?
 
Quote:

Originally Posted by DJ Data (Post 2227679)
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

Seta00 11-26-2014 10:07

Re: How to write a simple script for god mode?
 
I removed the binary and attached the source file.


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

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