Черная вдова
Участник
- Сообщения
- 2,795
- Реакции
- 670
скрипт нужен для того что бы игрок с флагом ban получал доп 2 к бабла при спавне
не знаю что писать после new OldMoney =
И вообще если какие-нибудь ошибки в скрипте?
не знаю что писать после new OldMoney =
И вообще если какие-нибудь ошибки в скрипте?
C-подобный:
#include <sourcemod>
#pragma semicolon 1
new Handle:c_cash;
new Handle:c_max;
new cash;
new max;
public OnPluginStart()
{
c_cash = CreateConVar("money_amount", "2000", "x = Cash");
c_max = CreateConVar("money_max", "0", "1 = Give not more than the max. Money, 0 = Off");
AutoExecConfig(true, "cash", "sourcemod");
HookEvent("player_spawn", eventPlayerSpawn);
}
public OnConfigsExecuted()
{
cash = GetConVarInt(c_cash);
max = GetConVarInt(c_max);
}
public Action:eventPlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new userid = GetEventInt(event, "userid");
new client = GetClientOfUserId(userid);
if(GetUserFlagBits(client) & ADMFLAG_BAN)
{
if ((GetClientTeam(client) == 2 || GetClientTeam(client) == 3))
{
new OldMoney =
new NewMoney = cash + OldMoney;
if (NewMoney > 16000 && max) NewMoney = 16000;
{
new MaxMoney = GetConVarInt(FindConVar("mp_maxmoney"));
if (NewMoney > MaxMoney) NewMoney = MaxMoney;
}
}
}
}