Hello,
I would like to create a plugin for my server. I posted a request but nobody answered me
:
http://forums.alliedmods.net/showthr...773#post655773
So, I would like to try to do it, but I will need your help to work fine
For the moment, I do that :
PHP Code:
#include <sourcemod>
#include <cstrike>
public Plugin:myinfo =
{
name = "Chicken cut",
author = "Me",
description = "Transform a player who have been cut in chicken just for the next round"
version = "1",
url = ""
}
public OnPluginStart()
{
HookEvent("player_death", Event_PlayerDeath)
}
public Action:Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
// I HAVE TO CHECK IF THE PLAYER WHO DIE WAS KILLED BY A KNIFE
if(GetEventInt(event, "weapon") == "knife"){
new victim_id = GetEventInt(event, "userid")
new victim = GetClientOfUserId(victim_id)
// I HAVE TO CREATE A FUNCTION TO TRANSFORM PLAYER IN CHICKEN JUST FOR THE NEXT ROUND
// BY MODIFYING HIS SKIN
// 1. IS THE PLAYER ALWAYS ONLINE BEFORE STARTING NEW ROUND ?
// 2. IS THE CURRENT ROUND THE GOOD ROUND (ROUND AFTER CUTTING) ?
// MAYBE I COULD CREATE A TEMPORARY DATA AND USE IT TO CHECK IF PLAYER'S SKIN HAVE BEEN YET MODIFIED OR NOT ?
// 3. IF ALL IS OK, HIS SKIN WILL BE CHANGE (IN CHICKEN) JUST FOR THE ROUND
// 4. WHEN THE NEW ROUND IS FINISHED, OR A NEW MAP IS LAUNCHED, OR BECAUSE PLAYER DISCONNECT WE HAVE TO CHANGE PLAYER SKIN, WITH THE STANDARD SKIN
// SO I HAVE TO CLEAR THE TEMPORARY DATA WE CREATE AT THE POINT 2
}
}
As I never create Sourcemod plugin, I don't know differents functions I have to use.
It will be great if you could give me some advices/examples !
Thanks