if you use [php] tags around your code it stays pretty.
furthermore this belongs in the scripting section.
like this:
PHP Code:
public OnPluginStart() {
HookEvent("player_death", Event_PlayerDeath);
}
public Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast) {
new victim = GetClientOfUserId(GetEventInt(event, "userid"));
if (victim == 'PREDAAATOR')
ServerCommand("mp_restartgame 1");
return Plugin_Handled;
}
it doesnt work because victim isnt the name of the player, but the id.
it should rather be like this:
PHP Code:
#pragma semicolon 1
public OnPluginStart() {
HookEvent("player_death", Event_PlayerDeath);
}
public Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast) {
new victim = GetClientOfUserId(GetEventInt(event, "userid"));
/*
//by player name - this is not a good idea
new String:sName[64];
GetClientName(victim, sName, sizeof(sName));
if (StrEqual(sName, "PREDAAATOR"))
ServerCommand("mp_restartgame 1");
*/
//by steam-id, this doesnt care about the players name
new String:sAuth[32];
GetClientAuthString(victim, sAuth, sizeof(sAuth));
if (StrEqual(sAUTH, "STEAM_0:1:23456"))
ServerCommand("mp_restartgame 1");
return Plugin_Handled;
}
__________________