19.08.2010, 09:14
pawn Код:
// I dont post the full code..
public OnPlayerConnect(playerid)
{
VipLogged[playerid]=0;
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
VipLogged[playerid]=0;
return 1;
}
public OnPlayerText(playerid, text[])
{
if(text[0] == '$' && VipLogged[playerid] == 1 )
{
new string[128],pName[MAX_PLAYER_NAME]; GetPlayerName(playerid,pName,sizeof(pName));
format(string,sizeof(string),"V.I.P Chat: %s: %s",pName,text[1]); MessageToVips(green,string);
}
return 0;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(vlogin,6,cmdtext);
dcmd(vtune,5,cmdtext);
dcmd(vmyip,5,cmdtext);
dcmd(vinterior,9,cmdtext);
dcmd(vfight,6,cmdtext);
if (strcmp("/night", cmdtext, true, 10) == 0)
{
if(VipLogged[playerid] == 1)
{
SetPlayerTime(playerid, 0,0);
SendClientMessage(playerid, COLOR_RED, "Your Time Has Been Succesfully changed.");
return 1;
}
}
if (strcmp("/morning", cmdtext, true, 10) == 0)
{
if(VipLogged[playerid] == 1)
{
SetPlayerTime(playerid, 7,1);
SendClientMessage(playerid, COLOR_RED, "Your time has been succesfully changed.");
return 1;
}
}
and
public MessageToVips(color,const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1) && VipLogged[i] == 1)
{
SendClientMessage(i, color, string);
return true;
}
}
return 1;
}