11.05.2018, 08:41
I'm New Any One Tell me what VIP Is best For Gang War Server Thanks
#include <a_Samp>
#include <sscanf2>
#include <zcmd>
new viplevel[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
viplevel[playerid]=0;
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
viplevel[playerid]=0;
return 1;
}
stock pname(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
return name;
}
CMD:setvip(playerid, params[])
{
new id, level, str[200];
if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, 0xFF00FF00, "USAGE: /setvip [playerid] [level]");
if(level < 0 || level > 3) return SendClientMessage(playerid, 0x000000FF, "Invalid level");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0x0000FFFF, "That player is not connected");
if(level == 1)
{
SetPlayerScore(id, 100);
GivePlayerMoney(id, 10000);
}
if(level == 2)
{
SetPlayerScore(id, 1000);
GivePlayerMoney(id, 100000);
}
if(level == 3)
{
SetPlayerScore(id, 1000);
GivePlayerMoney(id, 100000);
}
viplevel[id] = level;
format(str, sizeof(str), "%s has gave you %d vip level", pname(playerid), level);
SendClientMessage(id, 0x0066FFFF, str);
format(str, sizeof(str), "You have gave %d vip level to %s", level, pname(id));
SendClientMessage(id, 0x0066FFFF, str);
return 1;
}