Advertisement
Guest User

Untitled

a guest
Oct 19th, 2020
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. public OnPlayerUpdate(playerid)
  2. {
  3. if(IsPlayerNPC(playerid)) return 1;
  4. new dropbombs = GetPVarInt(playerid,"DroppingBombs");
  5. new i = GetPVarInt(playerid,"DroppingFrom");
  6. new Float:droptime = GetPVarFloat(playerid,"DropTime");
  7. if(dropbombs > 0)
  8. {
  9. if(ServerCar[i][v_localid]!=INVALID_VEHICLE_ID)
  10. {
  11. // printf("DEBUG: DREI: Spieler %s, dropbombs: %d, droptime: %f, gettime: %d Fahrzeug: %i",GetName(playerid),dropbombs, droptime, gettime(),i);
  12. DropBomb(playerid,0);
  13. droptime = gettime()+1;
  14.  
  15. SetPVarFloat(playerid,"DropTime",droptime);
  16. }
  17. }
  18. if (g_FlyMode[playerid][flyType] == 1 && PlayerInfo[playerid][IsConfiguringArtillery])
  19. {
  20. new
  21. Float:fPX, Float:fPY, Float:fPZ,
  22. Float:fVX, Float:fVY, Float:fVZ,
  23. Float:object_x, Float:object_y, Float:object_z;
  24.  
  25. const
  26. Float:fScale = 35.0;
  27.  
  28. GetPlayerCameraPos(playerid, fPX, fPY, fPZ);
  29. GetPlayerCameraFrontVector(playerid, fVX, fVY, fVZ);
  30.  
  31. object_x = fPX + floatmul(fVX, fScale);
  32. object_y = fPY + floatmul(fVY, fScale);
  33. object_z = fPZ + floatmul(fVZ, fScale);
  34.  
  35. SetPlayerCheckpoint(playerid,object_x, object_y, object_z,8.0);
  36.  
  37. PlayerInfo[playerid][pTargetArtPos_X] = object_x;
  38. PlayerInfo[playerid][pTargetArtPos_Y] = object_y;
  39. PlayerInfo[playerid][pTargetArtPos_Z] = object_z;
  40.  
  41. ShowPlayerBox(playerid,"Press ENTER to select a positon.",-1);
  42. }
  43. if(IsPlayerInAnyVehicle(playerid))
  44. {
  45. new string[16];
  46. format(string,sizeof(string),"%d kmp/h",GetPlayerSpeed(playerid));
  47. PlayerTextDrawSetString(playerid,kmphForPlayer[playerid],string);
  48. }
  49. new iCurWeap = GetPlayerWeapon(playerid);
  50. if(iCurWeap != GetPVarInt(playerid, "iCurrentWeapon"))
  51. {
  52. OnPlayerChangeWeapon(playerid, GetPVarInt(playerid, "iCurrentWeapon"), iCurWeap);
  53. SetPVarInt(playerid, "iCurrentWeapon", iCurWeap);//Update the weapon variable
  54. }
  55. return 1;
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement