Advertisement
toribio

toribio

Aug 12th, 2009
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.89 KB | None | 0 0
  1. //no topo:
  2. forward Posicao();
  3. new bool:inpoint[MAX_PLAYERS];
  4.  
  5. //no OnGameModeInit:
  6. SetTimer("Posicao", 1000, 1);
  7.  
  8. //no começo OnPlayerText:
  9. if(inpoint[playerid])
  10. {
  11.     new tmp[256], index, cor1, cor2;
  12.     tmp = strtok(text, index);
  13.     cor1 = strval(tmp);
  14.     tmp = strtok(text, index);
  15.     cor2 = strval(tmp);
  16.     if(!strlen(tmp))
  17.         return SendClientMessage(playerid, 0xFF0000AA, "Uso: [cor1] [cor2]");
  18.     if(!IsPlayerInAnyVehicle(playerid))
  19.         return SendClientMessage(playerid, 0xFF0000AA, "Você não está em um veículo!");
  20.     ChangeVehicleColor(GetPlayerVehicleID(playerid), cor1, cor2);
  21.     return 0;
  22. }
  23.  
  24. //no final do script:
  25. public Posicao()
  26. {
  27.     for(new i = 0; i < MAX_PLAYERS; ++i)
  28.     {
  29.         if(PlayerToPoint(10.0, i, x, y, z))
  30.         {
  31.             if(!inpoint[i])
  32.                 SendClientMessage(i, 0xFFF000AA, "Digite a cor que deseja (Uso: [cor1] [cor2])");
  33.             inpoint[i] = true;
  34.         } else {
  35.             inpoint[i] = false;
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement