10.06.2013, 14:35
pawn Код:
CMD:v(playerid, params[])
{
if(IsPlayerConnected(playerid) && PlayerInfo[playerid][pVIP] >= 1)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /v [Chat Vip]");
return true;
}
format(string, sizeof(string), "** VIP %s: %s", sendername, result);
SendVIPMessage(0xFFCCFFAA,string);
printf("VIP %s: %s", sendername, result);
}
return true;
}
pawn Код:
stock SendVIPMessage(color, string[]){
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pVIP] >= 1)
{
SendClientMessage(i, color, string);
}
}
}
}