11.03.2011, 05:13
pawn Код:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
new Vip[MAX_PLAYERS];
public OnPlayerText(playerid,text[])
{
if(Vip[playerid]==1)
{
if(text[0]=='-')
{
new string[128];
format(string,128,"Chat Vip- %s: %s",PlayerName(playerid),text[1]);
for(new i=0;i<MAX_PLAYERS,i++)
{
if(Vip[i]==1)SendClientMessage(i,0xFFFFFFFF,string);
}
}
}
}
public OnPlayerCommandText(playerid,cmdtext[])
{
dcmd(darvip,6,cmdtext);
return 0;
}
dcmd_darvi3(playerid,params[])
{
if(IsPlayerAdmin(playerid))
{
Vip[strval(params)]=1;
SendClientMessage(strval(params),0xFFFFFFFF,"enjoy chat vip sucesful");
}
return 1;
}
stock PlayerName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
return name;
}