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

[HELP]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Pbs
Junior Member
Join Date: Apr 2010
Old 06-20-2012 , 16:15   [HELP]
Reply With Quote #1

Okay so my friend decided to make a plugin but ofcourse it doesnt work could some 1 point out the mistakes ?
Code:
#include <sdktools>
#include <sourcemod>

new gift[MAXPLAYERS+1];

public Plugin:myinfo =
 {
	name = "Gift",
	author = "Diplomatas",
	description = "Redaguotas mokymosi tikslais Plugin Gift",
	version = "1.1",
	url="http://sourcemod.net"
 }

public OnPluginStar()
 {
	RegConsoleCmd("sm_gift", Command_Gift);

	HookEvent("player_spawn", OnPlayerSpawn);
 }

public OnPlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
 {
	new client = GetClientOfUserId(GetEventInt(event, "userid"));
	if(IsPlayerAlive(client))
	{
		PrintToChat(client, "[Info] : Rasyk !gift");
		gift[client] = 1;
	}
 }

public Action:Command_Gift(client, args)
 {
		if (IsPlayerAlive(client))
		{
			if (gift[client] > 0)
			{
				new bonus = GetRandomInt(1,20);

				if(bonus == 1)
				{
					new health = GetClientHealth(client);
					new nowhealth = health + 45;

					SetEntityHealth(client, nowhealth);

					PrintToChat(client, "[Info] : Laimejai +45 HP");

					gift[client]--;

					return Plugin_Handled;
				}
				else if (bonus == 2)
				{
					GivePlayerItem(client, "weapon_hegrenade");
					GivePlayerItem(client, "weapon_flashbang");
					GivePlayerItem(client, "weapon_smokegrenade");

					PrintToChat(client, "[Info] : Laimejai granatu rinkini");

					gift[client]--;

					return Plugin_Handled;
				}
				else if (bonus == 3)
				{
					new Float:speed = GetEntPropFloat(client,Prop_Data, "m_flLaggedMovementValue");
					new Float:nowspeed = speed + 0.4;
					SetEntPropFloat(client,Prop_Data, "m_flLaggedMovementValue", nowspeed);

					PrintToChat(client, "[Info] : Esi greitesnis uz kitus");

					gift[client]--;

					return Plugin_Handled;
				}
				else if (bonus == 4)
				{
					PrintToChat(client, "[Info] : Nieko nelaimejai");

					gift[client]--;

					return Plugin_Handled;
				}
				else if (bonus == 5)
				{
					GivePlayerItem(client, "weapon_usp");

					PrintToChat(client, "[Info] : Laimejai USP");

					gift[client]--;

					return Plugin_Handled;
				}
				else if (bonus == 6)
				{
					PrintToChat(client, "[Info] : Nieko nelaimejai");

					gift[client]--;

					return Plugin_Handled;
				}
				else if (bonus == 7)
				{
					PrintToChat(client, "[Info] : Nieko nelaimejai");

					gift[client]--;

					return Plugin_Handled;
				}
				else if (bonus == 8)
				{
					PrintToChat(client, "[Info] : Nieko nelaimejai");

					gift[client]--;

					return Plugin_Handled;
				}
				else if (bonus == 9)
				{
					PrintToChat(client, "[Info] : Nieko nelaimejai");

					gift[client]--;

					return Plugin_Handled;
				}
				else if (bonus == 10)
				{
					PrintToChat(client, "[Info] : Nieko nelaimejai");

					gift[client]--;

					return Plugin_Handled;
				}
				else if (bonus == 11)
				{
					PrintToChat(client, "[Info] : Nieko nelaimejai");

					gift[client]--;

					return Plugin_Handled;
				}
				else if (bonus == 12)
				{
					PrintToChat(client, "[Info] : Nieko nelaimejai");

					gift[client]--;

					return Plugin_Handled;
				}
				else if (bonus == 13)
				{
					PrintToChat(client, "[Info] : Nieko nelaimejai");

					gift[client]--;

					return Plugin_Handled;
				}
				else if (bonus == 14)
				{
					PrintToChat(client, "[Info] : Nieko nelaimejai");

					gift[client]--;

					return Plugin_Handled;
				}
				else if (bonus == 15)
				{
					PrintToChat(client, "[Info] : Nieko nelaimejai");

					gift[client]--;

					return Plugin_Handled;
				}
				else if (bonus == 16)
				{
					PrintToChat(client, "[Info] : Nieko nelaimejai");

					gift[client]--;

					return Plugin_Handled;
				}
				else if (bonus == 17)
				{
					PrintToChat(client, "[Info] : Nieko nelaimejai");

					gift[client]--;

					return Plugin_Handled;
				}
				else if (bonus == 18)
				{
					PrintToChat(client, "[Info] : Nieko nelaimejai");

					gift[client]--;

					return Plugin_Handled;
				}
				else if (bonus == 19)
				{
					PrintToChat(client, "[Info] : Nieko nelaimejai");

					gift[client]--;

					return Plugin_Handled;
				}
				else if (bonus == 20)
				{
					PrintToChat(client, "[Info] : Nieko nelaimejai");

					gift[client]--;

					return Plugin_Handled;
				}
			}
				else
				{
				PrintToChat(client, "[Info] : Jau gavai savo dovana");

				return Plugin_Handled;
				}
	}
			else
			{
				PrintToChat(client, "[Info] : Turi buti gyvas, kad gautum dovana");

				return Plugin_Handled;
			}
			return Plugin_Continue;
}
Pbs is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 06-20-2012 , 16:33   Re: [HELP]
Reply With Quote #2

This code looks familiar... it seems like I've edited it before. Wasn't quite the same, nor was it in the same language.

(I've attached the old version)
Attached Files
File Type: sp Get Plugin or Get Source (gift.sp - 183 views - 3.9 KB)
File Type: zip gift translations.zip (2.7 KB, 50 views)
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 06-20-2012 at 16:36.
Powerlord is offline
Pbs
Junior Member
Join Date: Apr 2010
Old 06-20-2012 , 16:46   Re: [HELP]
Reply With Quote #3

Thanks for such a fast reply. Ye this should help him out. Thank you very much.
Pbs 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 11:59.


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