DexterBRSan

fs, salvar posição

Jan 9th, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. if (strcmp(cmdtext, "n", true)==0)
  2. {
  3. GetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
  4. GetPlayerFacingAngle(playerid, PosA[playerid]);
  5. SendClientMessage(playerid, COR, "Você guardou a posição use 'n'!");
  6. PosI[playerid] = (GetPlayerInterior(playerid));
  7. PlayerPlaySound(playerid, 1137 , 0.0, 0.0, 0.0);
  8. return 1;
  9. }
  10.  
  11. if (strcmp(cmdtext, "y", true)==0)
  12. {
  13. if (!floatsqroot(PosX[playerid]+PosY[playerid]+PosZ[playerid]))
  14. {
  15. return SendClientMessage(playerid, COR, "Deve salvar antes!'n'");
  16. }
  17. else
  18. {
  19. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  20. {
  21. SetVehiclePos(GetPlayerVehicleID(playerid), PosX[playerid], PosY[playerid], PosZ[playerid]);
  22. SetVehicleZAngle(GetPlayerVehicleID(playerid), PosA[playerid]);
  23. SetCameraBehindPlayer(playerid);
  24. LinkVehicleToInterior(GetPlayerVehicleID(playerid), PosI[playerid]);
  25. }
  26. else
  27. {
  28. EnCoche[playerid] = false;
  29. SetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
  30. SetPlayerFacingAngle(playerid, PosA[playerid]);
  31. SetCameraBehindPlayer(playerid);
  32. }
  33. PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
  34. SetPlayerInterior(playerid, PosI[playerid]);
  35. SendClientMessage(playerid, COR, "Posição carregada com sucesso!!");
  36. }
  37. return 1;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment