Hello, i was requested for make this plugin work this way. If someone keeps the pistol example (usp,glock,dualies and more..) at the end of round, pistol wil be not replaced by deagle. If someone dies or drops the pistol. He will get a deagle at start of the round. Normal script (pistol is always replaced with deagle)
PHP Code:
public OnPluginStart()
{
HookEvent("player_spawn", Event_PlayerSpawn);
}
public Action:Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
new weaponEntity = GetPlayerWeaponSlot(client, 1);
if (IsValidEntity(weaponEntity))
{
RemovePlayerItem(client, weaponEntity);
RemoveEdict(weaponEntity);
}
GivePlayerItem(client, "weapon_deagle", 0);
GivePlayerItem(client, "item_assaultsuit", 0);
return;
}
PHP Code:
public OnPluginStart()
{
HookEvent("player_spawn", Event_PlayerSpawn);
}
public Action:Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
new weaponEntity = GetPlayerWeaponSlot(client, 1);
GivePlayerItem(client, "weapon_deagle", 0);
GivePlayerItem(client, "item_assaultsuit", 0);
return;
}
This is how i tried to make it "work"
If i remove this, the plugin will never give you deagle. Even if you drop the pistol or die. You always get the basic starting pistol.
PHP Code:
if (IsValidEntity(weaponEntity))
{
RemovePlayerItem(client, weaponEntity);
RemoveEdict(weaponEntity);
}
I saw it on one server working this way. But i don't know how to make it happen on mine. Any ideas how to make it happen? I tried more things, but still without change

.
Thanks, all advices will be appreciate.