Hello, I started Sourcepawn a few days ago and now I'm having trouble compiling this code. On the CreateTimer line, it says "function prototypes do not match."
Code:
#include <sourcemod>
#include <sdktools>
public Plugin:myinfo =
{
name = "Roll the Dice",
description = "Type !rtd to roll the dice. Okay?",
author = "White Noise/Zapulater/Fishyboy",
version = "1.0",
url = "www.zpdcom.forumotion.com/"
}
public OnPluginStart()
{
PrintToServer("Type !rtd to roll the dice")
RegConsoleCmd("sm_rtd", CommandRtd)
}
public Action:CommandRtd(client, args)
{
new rtd = GetRandomInt(1,7)
switch (rtd)
{
case 1:
{
SetEntityHealth(client, GetClientHealth(client)-15)
PrintToChat( client, "You have lost 15 health!" )
}
case 2:
{
SetEntityRenderColor(client, GetRandomInt(1,255), GetRandomInt(1,255), GetRandomInt(1,255), GetRandomInt(100,255))
PrintToChat( client, "Your color has been changed!" )
}
case 3:
{
PrintToChat( client, "You have received a useless message!" )
}
case 4:
{
new rand = GetRandomInt(-5,5)
SlapPlayer( client, rand, false )
PrintToChat( client, "You have been launched into the air and your health has been changed by %d", rand )
}
case 5:
{
SetEntityHealth(client, GetClientHealth(client)+15)
PrintToChat( client, "You have gained 15 health!" )
}
case 6:
{
GivePlayerItem( client, "pistol_magnum", 1 )
PrintToChat( client, "You have gained a magnum!" )
}
case 7:
{
CreateTimer( 3.0, Timer_Regen, _, TIMER_REPEAT ) // This is the line with the problem.
}
}
}
public Action:Timer_Regen( client )
{
new health = GetClientHealth(client)
new sum = health
if (health>=100 && IsPlayerAlive(client)==true)
{
sum = health
}
else
{
sum = health+1
}
SetEntityHealth( client, sum )
return Plugin_Continue;
}
I'm probably making a noob mistake here, but a brief reply on what I'm doing wrong would help.
Thanks!