Advertisement
SeC

Untitled

SeC
Aug 22nd, 2011
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. Sotto include a_samp:
  2.  
  3. new bool:WindowsState[MAX_VEHICLES] = false;//true se il finestrino è aperto, false se il finestrino è chiuso..
  4. new Nome[24], stringa[128];
  5.  
  6. public OnVehicleSpawn(vehicleid)
  7. {
  8. WindowsState[vehicleid] = false;
  9. return 1;
  10. }
  11.  
  12.  
  13. public OnPlayerText(playerid, text[])
  14. {
  15. new Veh = GetPlayerVehicleID(playerid);
  16. if(WindowsState[Veh] == false)
  17. {
  18. format(stringa,sizeof(stringa),"[Finestrino Chiuso] %s dice: %s", Nome, text);
  19. // SendRangedMessage(playerid, 0xFFF0FF, stringa);
  20. }
  21. else if(WindowsState[Veh] == true)
  22. {
  23. format(stringa,sizeof(stringa),"[Finestrino Aperto] %s dice: %s", Nome, text);
  24. // SendRangedMessage(playerid, 0xFFF0FF, stringa);
  25. }
  26. return 1;
  27. }
  28.  
  29. new Veh = GetPlayerVehicleID(playerid);
  30. if (strcmp("/finestrino", cmdtext, true, 10) == 0)
  31. {
  32. GetPlayerName(playerid, Nome, sizeof(Nome));
  33. if(Veh == 522 || Veh == 481 || Veh == 510 || Veh == 462 || Veh == 448 || Veh == 581 ||Veh == 461 || Veh == 521 || Veh == 523 || Veh == 463 || Veh == 586 || Veh == 468 || Veh == 471)return SendClientMessage(playerid, -1, "Non sei in un veicolo con il finestrino!");
  34. if(WindowsState[Veh] == false)
  35. {
  36. WindowsState[Veh] = true;
  37. format(stringa,sizeof(stringa),"%s abbassa il finestrino", Nome);
  38. //SendRangedMessage(playerid, 0xFFF0FF, stringa);
  39. }
  40. else if(WindowsState[Veh] == true)
  41. {
  42. WindowsState[Veh] = false;
  43. format(stringa,sizeof(stringa),"%s chiude il finestrino", Nome);
  44. //SendRangedMessage(playerid, 0xFFF0FF, stringa);
  45. }
  46. return 1;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement