Guest User

Untitled

a guest
Feb 18th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. if (strcmp("/casco", cmdtext, true, 10) == 0)
  2. {
  3. if(IsPlayerInAnyVehicle(playerid))
  4. {
  5. if(IsModelABike(GetPlayerVehicleID(playerid)))
  6. {
  7. if(UsingHelmet[playerid] == 0)
  8. {
  9. SendClientMessage(playerid, COLOR_GREEN, "* Ti sei messo il casco");
  10. GetPlayerName(playerid,pn,sizeof(pn));
  11. format(string, sizeof(string), "* %s prende un casco dalla sella e lo indossa", pn);
  12. SendClientMessage(playerid,COLOR_PURPLE,string);
  13. UsingHelmet[playerid] = 1;
  14. SetPlayerAttachedObject(playerid, 1, 18645, 2, 0.07, 0.0, 0.0, 88, 75, 0);
  15. }
  16. else if(UsingHelmet[playerid] == 1)
  17. {
  18. SendClientMessage(playerid, COLOR_GREEN, "* Ti sei tolto il casco");
  19. GetPlayerName(playerid,pn,sizeof(pn));
  20. format(string, sizeof(string), "* %s posa il casco sotto la sella", pn);
  21. SendClientMessage(playerid,COLOR_PURPLE,string);
  22. UsingHelmet[playerid] = 0;
  23.  
  24. }
  25. }
  26. else if(!IsModelABike(GetPlayerVehicleID(playerid))) SendClientMessage(playerid, COLOR_RED, "Non sei in una moto o in una bici");
  27. }
  28. else if(!IsPlayerInAnyVehicle(playerid) && UsingHelmet[playerid] == 0) SendClientMessage(playerid, COLOR_RED, "Non sei in una moto o in una bici");
  29. if(!IsPlayerInAnyVehicle(playerid) && UsingHelmet[playerid] == 1)
  30. {
  31. SendClientMessage(playerid, COLOR_GREEN, "* Ti sei tolto il casco");
  32. GetPlayerName(playerid,pn,sizeof(pn));
  33. format(string, sizeof(string), "* %s si รจ tolto il casco", pn);
  34. SendClientMessage(playerid,COLOR_PURPLE,string);
  35. UsingHelmet[playerid] = 0;
  36. RemovePlayerAttachedObject(playerid, 1);
  37. }
  38. return 1;
  39. }
Add Comment
Please, Sign In to add comment