PDA

View Full Version : It Give 2 Times ..(


mithat999
08-09-2016, 04:58
//proplem fixed ty grey38

Grey83
08-09-2016, 07:33
You not need this:#include <autoexecconfig>

Handle g_HClanTag = INVALID_HANDLE;Maybenew Handle g_HClanTag;?

public OnMapStart()
{
CreateTimer(400.0, HOOKLAMAK);
}

public Action HOOKLAMAK(Handle timer, any client)
{
HookEvent("player_spawn" , Spawnn);
}what should happen after 6 minutes and 40 seconds after start map?
Why not justpublic OnPluginStart()
{
...
HookEvent("player_spawn" , Spawnn);
...
}?

new Float:sures = GetConVarFloat(Sure);
CreateTimer(sures, Reklam, any:0, 1);O_o
Maybe better this wayCreateTimer(GetConVarFloat(Sure), Reklam, _, 1); (and maybe better place it in the OnMapStart)?

char requiredClanTag[180];If You use old syntax it should look like this:new String:requiredClanTag[16];(180?! O_o Are you sure the game supports so long tags?)

BTW, how many warnings 'warning 217: loose indentation' You see when you compile Your code?

mithat999
08-09-2016, 07:45
Yes İ Changed With Your Code But İts Give Again When Player Spawn 2 Times Cash And İts Print To Chat 2 TİMES..

Grey83
08-09-2016, 08:42
try this

mithat999
08-09-2016, 08:46
FIXED

Grey83
08-09-2016, 08:50
mithat999, I accidentally deleted a semicolon. =)
Fixed

mithat999
08-09-2016, 09:25
lel thanks for helping bro

Mitchell
08-09-2016, 10:06
You shouldn't need to hook the player_spawn on map start OnMapStart, well atleast back in the day you would have needed to remove the hook on OnMapEnd in order for the even to not be hooked more than once. player_spawn also fires when the player connects, around the time he looks at the motd. You can get around this firing by just checking if the player is alive. (IsPlayerAlive(client))

Grey83
08-09-2016, 16:23
player_spawn also fires when the player connects, around the time he looks at the motdI don't know about this

Mitchell
08-09-2016, 18:22
I don't know about this

I usually only see this on cs:s and cs:go. Checking the player's team will also get around this.

ddhoward
08-09-2016, 18:40
It also happens on tf2. An IsPlayerAlive check is usually how I avoid problems there.