if(strcmp(cmd, "/darvip", true) == 0)
{
new editarnome[MAX_PLAYER_NAME];
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0x00F5AAAF, "USE: /darvip [id/nome] [numero] [3 - 5]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0x00F5AAAF, "USE: /darvip [id/nome] [numero] [3 - 5]");
return 1;
}
new stat;
stat = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0x00F5AAAF, "USE: /darvip [id/nome] [numero] [3 - 5]");
return 1;
}
new quantidade;
quantidade = strval(tmp);
switch (stat)
{
case 1:
{
if (PlayerInfo[playerid][pAdmin] >= 3)
{
new vipnome[MAX_PLAYER_NAME];
GetPlayerName(giveplayerid,vipnome,sizeof(vipnome));
PlayerInfo[giveplayerid][pVIP] = quantidade;
new year, month,day;
getdate(year, month, day);
new hour, minute;
gettime(hour,minute);
format(string, sizeof(string), "%s deu vip ao %s nнvel %d ( %d/%d/%d - %d:%d)",editarnome,vipnome,quantidade,year, month, day,hour, minute);
VipsLog(string);
ABroadCast(0x00FFAAFF,string,1);
}
else
{
SendClientMessage(playerid, 0x00AAFFAA, "Vocк nгo estб autorizado a faser isso");
}
}
}
}
}
return 1;
}
if (strcmp(cmd, "/vips", true) == 0)
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, 0x00F600AA, "|_____________VIPS ONLINE_____________|");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pVIP] == 3)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "VIP: %s - VIP NORMAL", sendername);
SendClientMessage(playerid, 0xFFFFFFAA, string);
}
else if(PlayerInfo[i][pVIP] == 4)
{
GetPlayerName(i,sendername,sizeof(sendername));
format(string,256, "VIP: %s - VIP PRATA",sendername);
SendClientMessage(playerid, 0x33CCFFAA, string);
}
else if(PlayerInfo[i][pVIP] == 5)
{
GetPlayerName(i,sendername,sizeof(sendername));
format(string,256, "VIP: %s - VIP OURO",sendername);
SendClientMessage(playerid, 0xFFFF00AA, string);
}
}
}
}
return 1;
}
usa um sistema mais avanзado.
jб cancei de strtok. https://sampforum.blast.hk/showthread.php?tid=120356 |