Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- #include <sdktools>
- #include <cstrike>
- #include <sdkhooks>
- int g_fLastButtons[MAXPLAYERS+1];
- int g_fLastFlags[MAXPLAYERS+1];
- int g_iJumps[MAXPLAYERS+1];
- public Plugin:myinfo =
- {
- name = "VIP ",
- author = "NWayne",
- description = "VIP",
- version = "1.0",
- url = "hardstrike.eu"
- }
- public OnPluginStart()
- {
- HookEvent("player_spawn", Event_PlayerSpawn);
- HookEvent("player_death", Event_PlayerDeath);
- }
- public OnClientPutInServer(client)
- {
- if(IsValidPlayer(client)&&GetUserFlagBits(client)&(1<<ADMFLAG_CUSTOM1))
- {
- char name[32];
- GetClientName(client,name,31);
- PrintToChatAll("\x02 >> \x07 Vip \x03 %s \x04 wszedl na serwer!",name);
- SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
- }
- }
- public Action:Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
- {
- int client = GetClientOfUserId(GetEventInt(event, "attacker"));
- if(IsValidPlayer(client)&&GetUserFlagBits(client)&(1<<ADMFLAG_CUSTOM1))
- {
- SetEntityHealth(client, GetEntProp(client, Prop_Send, "m_iHealth")+170);
- SetEntProp(client, Prop_Send, "m_iAccount", GetEntProp(client, Prop_Send, "m_iAccount")+1000);
- }
- }
- public Action:Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
- {
- int client = GetClientOfUserId(GetEventInt(event, "attacker"));
- bool headshot = GetEventBool(event, "headshot");
- if(IsValidPlayer(client)&&GetUserFlagBits(client)&(1<<ADMFLAG_CUSTOM1))
- {
- SetEntityHealth(client, GetEntProp(client, Prop_Send, "m_iHealth")+10);
- if(headshot)
- SetEntityHealth(client, GetEntProp(client, Prop_Send, "m_iHealth")+15);
- if(GetEntProp(client, Prop_Send, "m_iHealth")>50)
- SetEntityHealth(client, 50);
- SetEntProp(client, Prop_Send, "m_iAccount", GetEntProp(client, Prop_Send, "m_iAccount")+50);
- if(headshot)
- SetEntProp(client, Prop_Send, "m_iAccount", GetEntProp(client, Prop_Send, "m_iAccount")+70);
- }
- }
- public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon)
- {
- if(IsValidPlayer(client)&&GetUserFlagBits(client)&(1<<ADMFLAG_CUSTOM1))
- {
- int fCurFlags = GetEntityFlags(client);
- int fCurButtons = GetClientButtons(client);
- if (g_fLastFlags[client] & FL_ONGROUND)
- {
- if (!(fCurFlags & FL_ONGROUND) &&!(g_fLastButtons[client] & IN_JUMP) && fCurButtons & IN_JUMP)
- {
- g_iJumps[client]++;
- }
- }
- else if (fCurFlags & FL_ONGROUND)
- {
- g_iJumps[client] = 0;
- }
- else if (!(g_fLastButtons[client] & IN_JUMP) && fCurButtons & IN_JUMP)
- {
- if ( 1 <= g_iJumps[client] <= 3)
- {
- g_iJumps[client]++;
- float vVel[3];
- GetEntPropVector(client, Prop_Data, "m_vecVelocity", vVel);
- vVel[2] = 250.0;
- TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, vVel);
- }
- }
- g_fLastFlags[client] = fCurFlags;
- g_fLastButtons[client] = fCurButtons;
- }
- }
- public Action:OnTakeDamage(client, &attacker, &inflictor, &Float:damage, &damagetype)
- {
- if(IsValidPlayer(client)&&GetUserFlagBits(client)&(1<<ADMFLAG_CUSTOM1))
- {
- if(damagetype & DMG_FALL)
- {
- return Plugin_Handled;
- }
- }
- return Plugin_Continue;
- }
- stock bool IsValidPlayer(client)
- {
- if(client >= 1 && client <= MaxClients && IsClientConnected(client) && !IsFakeClient(client) && IsClientInGame(client) )
- return true;
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement