Shadoww5

Untitled

Jan 26th, 2012
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.99 KB | None | 0 0
  1. Procure por new PlayerInfo no seu GM e duas linhas antes do };, coloque isto:
  2.  
  3. [code]pDays,[/code]
  4.  
  5. Lembre-se, também, de fazer o saving e loading da variavel.
  6.  
  7. [php]public OnPlayerUpdate(playerid)
  8. {
  9. if(PlayerInfo[playerid][pVIP] != 0 && gettime() >= PlayerInfo[playerid][pDays])
  10. {
  11. SendClientMessage(playerid, -1, "Seu período de VIP acabou.");
  12. PlayerInfo[giveid][pVIP] = 0;
  13. PlayerInfo[playerid][pDays] = 0;
  14. new sStr[24];
  15. GetPlayerName(playerid, sStr, 24);
  16. for(new i = 0; i < sizeof(VipInfo); i++)
  17. {
  18. if(strcmp(sStr,VipInfo[i][vNick],true)==0)
  19. {
  20. VipInfo[i][vTipo] = 0;
  21. strmid(VipInfo[i][vNick], "Ninguem", 0, 16, 255);
  22. return SaveVip();
  23. }
  24. }
  25. }
  26. return 1;
  27. }
  28.  
  29. public OnPlayerCommandText(playerid, cmdtext[])
  30. {
  31. if(strcmp(cmd, "/darvip", true) == 0)
  32. {
  33. if(PlayerInfo[playerid][pAdmin] < 1337)
  34. return SendClientMessage(playerid, COLOR_GRAD1, "Você não tem autorização para usar esse comando.");
  35. VipVaga();
  36. if(!VagaSobrando)
  37. return SendClientMessage(playerid, COLOR_GRAD1, "Não há mais vagas na lista use /limparvip primeiro.");
  38. tmp = strtok(cmdtext, idx);
  39. if(!strlen(tmp))
  40. return SendClientMessage(playerid, COLOR_GRAD2, "USE: /darvip [id] [nivel] [dias]");
  41. new giveid = ReturnUser(tmp);
  42. tmp = strtok(cmdtext, idx);
  43. if(!strlen(tmp))
  44. return SendClientMessage(playerid, COLOR_GRAD2, "USE: /darvip [id] [nivel] [dias]");
  45. new level = strval(tmp);
  46. tmp = strtok(cmdtext, idx);
  47. if(!strlen(tmp))
  48. return SendClientMessage(playerid, COLOR_GRAD2, "USE: /darvip [id] [nivel] [dias]");
  49. new dias = strval(tmp);
  50. GetPlayerName(giveid, giveplayer, sizeof(giveplayer));
  51. GetPlayerName(playerid, sendername, sizeof(sendername));
  52. if(!IsPlayerConnected(giveid) || giveid != INVALID_PLAYER_ID)
  53. return 1;
  54. format(string, sizeof string, "Você deu VIP Nível %d para %s por %d dias", level, giveplayer, dias);
  55. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  56. format(string, sizeof string, "Você ganhou VIP Nível %d por %d dias do admin %s", level, dias, sendername);
  57. SendClientMessage(giveid, COLOR_LIGHTBLUE, string);
  58. getdate(year, month, day);
  59. gettime(hour,minute,second);
  60. format(string, sizeof(string), "%s deu vip ao %s nível %d por %d dias (%d/%d/%d - %d:%d)",sendername,giveplayer,level, dias, day, month, year,hour, minute);
  61. VipsLog(string);
  62. PlayerInfo[giveid][pVIP] = level;
  63. PlayerInfo[giveid][pDays] = gettime()+dias*86400;
  64. for(new i = 0; i < sizeof(VipInfo); i++)
  65. {
  66. if(strcmp(giveplayer,VipInfo[i][vNick],true)==0)
  67. {
  68. VipInfo[i][vTipo] = level;
  69. return SaveVip();
  70. }
  71. if(strcmp("Ninguem",VipInfo[i][vNick],true)==0)
  72. {
  73. VipInfo[i][vTipo] = level;
  74. return SaveVip();
  75. }
  76. }
  77. return 1;
  78. }
  79. return 0;
  80. }[/php]
Advertisement
Add Comment
Please, Sign In to add comment