Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- new Float:PosX[MAX_PLAYERS], Float:PosY[MAX_PLAYERS], Float:PosZ[MAX_PLAYERS], Float:PosA[MAX_PLAYERS], PosI[MAX_PLAYERS];
- new bool: EnCoche[MAX_PLAYERS];
- public OnPlayerCommandText(playerid, cmdtext[]){
- if (strcmp("/sp", cmdtext, true, 10) == 0){
- GetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
- GetPlayerFacingAngle(playerid, PosA[playerid]);
- SendClientMessage(playerid, 0x57E427AA, "[INFO]: Sua posição foi salva, para voltar use: /irp");
- PosI[playerid] = (GetPlayerInterior(playerid));
- PlayerPlaySound(playerid, 1137 , 0.0, 0.0, 0.0);
- return 1;
- }
- if (strcmp("/irp", cmdtext, true, 10) == 0){
- if (!floatsqroot(PosX[playerid]+PosY[playerid]+PosZ[playerid]))
- {
- SendClientMessage(playerid, 0xF60000AA, "[ERRO] Você não tem nenhuma posição salva.");
- }
- else
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- SetVehiclePos(GetPlayerVehicleID(playerid), PosX[playerid], PosY[playerid], PosZ[playerid]);
- SetVehicleZAngle(GetPlayerVehicleID(playerid), PosA[playerid]);
- SetCameraBehindPlayer(playerid);
- LinkVehicleToInterior(GetPlayerVehicleID(playerid), PosI[playerid]);
- }
- else
- {
- EnCoche[playerid] = false;
- SetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
- SetPlayerFacingAngle(playerid, PosA[playerid]);
- SetCameraBehindPlayer(playerid);
- }
- PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
- SetPlayerInterior(playerid, PosI[playerid]);
- SendClientMessage(playerid, 0x008040FF, "Você se teleportou para a ultima posição salva.");
- }
- return 1;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement