Request vip system [HELP] -
mohdapiz - 11.07.2014
hello everyone. i have done make vip system in my gamemode the command like this
//////vip
CMDetvip(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return 0;//This will make the command work for rcon, if your not rcon it will do SERVER: Unknown Command
if(sscanf(params,"ui",ID,levels)) return SendClientMessage(playerid,0xFF9900AA, "USAGE: /setvip [playerid / partofname] contoh /setvip [playerid] 1 to vip");//If you do not use the format /setvip properly it will show how to
if(ID == INVALID_PLAYER_ID) return SendClientMessage(playerid,0xFF0000FF, "That user is not connected.");//if its an unknown ID, it will show that person is not connected
if(levels > 1) return SendClientMessage(playerid,0xFF0000FF,"AVAILABLE VIP LEVELS 1!"); //If you add a number over 3 for /setvip, ex: /setvip Tanush 1000, it will show that message
if(levels == 1)//if you select vip level 0
{
if(PlayerInfo[ID][vip] == 1) return SendClientMessage(playerid,0xFF0000FF,"ERROR: That person is already level 0 vip!");// If the person you attempt to /setvip that is already level 0 vip, it will show that
GetPlayerName(playerid,Nam, MAX_PLAYER_NAME);//Defines the playerid name
GetPlayerName(ID,pname,MAX_PLAYER_NAME);//Defines the other player name
format(str, sizeof(str),"%s has set your to VIP!",Nam);//string
SendClientMessage(ID,0xFF9900AA,str);//It will send the other person a message that %s has set your vip level to 0
format(str,sizeof(str),"You had set %s to VIP!",pname);//string
SendClientMessage(playerid,0xFF9900AA,str);//This will send you that you had set %s vip level to 0
PlayerInfo[ID][vip] = 1;//Sets the other person vip level to 0
}
return 1;
}
i have done all compile..
i want to ask how to make when player VIP and he enter server it shows
- VIP mohdapiz has join the server
please help me
sorry for my bad english
Re: Request vip system [HELP] -
ABKPot - 11.07.2014
This is basic code.. I suggest searching the forums next time.
pawn Код:
public OnPlayerConnect(playerid)
{
if(PlayerInfo[playerid][vip] == 1)
{
new str[70], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(str, sizeof(str), "VIP %s has joined the server!", pName);
SendClientMessageToAll(0x001080, str);
}
return 1;
}