garfield

[INC] GetVehicleColor - Pegue a cor do seu veiculo!

Oct 11th, 2011
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.43 KB | None | 0 0
  1. /*
  2.         @_ Pequena include GetVehicleColor Criada por SuYaNw Dácio.
  3.         @_ Blog: www.ips-team.blogspot.com
  4.         @_ MSN: [email protected]
  5. */
  6.  
  7. #if !defined _samp_included
  8.     #tryinclude a_samp
  9. #endif
  10. #if !defined _samp_included
  11.     #error The include a_samp now exists!
  12. #endif
  13.  
  14. enum enumerador_ips
  15. {
  16.     Cor1,   Cor2
  17. };
  18.  
  19. static stock
  20.     iPs_Cars[MAX_VEHICLES][enumerador_ips]
  21. ;
  22.  
  23. static stock iPs_CreateVehicle(modelid, Float:_ips_X,Float:_ips_Y,Float:_ips_Z, Float:_ips_A, COR1, COR2, respawndelay = 0)
  24. {
  25.     static tempveh;
  26.     tempveh  =  CreateVehicle(modelid, _ips_X,_ips_Y,_ips_Z, _ips_A, COR1, COR2, respawndelay);
  27.     iPs_Cars[tempveh][Cor1]   = COR1;
  28.     iPs_Cars[tempveh][Cor2]   = COR2;
  29.     return 1;
  30. }
  31. static stock iPs_GetVehicleColor(vehicleid, ncolor)
  32. {
  33.     if(ncolor > 2 || ncolor < 0)
  34.         return printf("WARNING: INVALID_COLOR_ID - (COR:%i)", ncolor);
  35.     if(!ncolor) return iPs_Cars[vehicleid][Cor1];
  36.     if(ncolor)  return iPs_Cars[vehicleid][Cor2];
  37.     return 0;
  38. }
  39.  
  40.  
  41. /*
  42.     Tutorial para utilizar:
  43.     Subistitua todos os CreateVehicle por iPs_CreateVehicle.
  44.    
  45.     Exemplo de uso:
  46.  
  47.     if(!strcmp(cmdtext,"/ips", true))
  48.     {
  49.         new veh = 0;
  50.         new Float:x, Float:y, Float:z; GetPlayerPos(playerid,x,y,z);
  51.         veh = iPs_CreateVehicle(522,x,y,z,0.0, 11, 6, 1000);
  52.         new id = iPs_GetVehicleColor(veh, 0);
  53.         printf("Cor 1 do veiculo é : %d", id);
  54.         id = iPs_GetVehicleColor(veh, 1);
  55.         printf("Cor 2 do veiculo é : %d", id)
  56.         return 1;
  57.     }
  58. */
Advertisement
Add Comment
Please, Sign In to add comment