Vá no: OnPlayerCommandText
f(strcmp(cmdtext, "/COMANDO QUE IRÁ PRO TELE", true) == 0){
if(IsPlayerInAnyVehicle(playerid) == 1) {
SetPlayerInterior(playerid, 0);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
SetVehiclePos(GetPlayerVehicleID(playerid),COORDENADAS DO TELE);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 256.9824);
LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
} else {
RemovePlayerFromVehicle(playerid);
SetPlayerPos(playerid,AS MESMAS COORDENADAS DO TELE ACIMA);
SetPlayerFacingAngle(playerid, 256.9824);
SetCameraBehindPlayer(playerid);
}
} else {
SetPlayerPos(playerid,AS MESMAS COORDENADAS DO TELE ACIMA);
SetPlayerFacingAngle(playerid, 256.9824);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 0);
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "[xDc] %s foi para( /NOME DO TELE )", pname);
SendClientMessageToAll(COLOR_BLUE, string);
}
return 1;
}
Um exemplo de teleporte que eu fiz:
f(strcmp(cmdtext, "/lossantos", true) == 0){
if(IsPlayerInAnyVehicle(playerid) == 1) {
SetPlayerInterior(playerid, 0);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
SetVehiclePos(GetPlayerVehicleID(playerid),1529.6,-1691.2,13.3);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 256.9824);
LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
} else {
RemovePlayerFromVehicle(playerid);
SetPlayerPos(playerid,1529.6,-1691.2,13.3);
SetPlayerFacingAngle(playerid, 256.9824);
SetCameraBehindPlayer(playerid);
}
} else {
SetPlayerPos(playerid,1529.6,-1691.2,13.3);
SetPlayerFacingAngle(playerid, 256.9824);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 0);
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "[xDc] %s foi para( /lossantos )", pname);
SendClientMessageToAll(COLOR_BLUE, string);
}
return 1;
}
Nenhum comentário:
Postar um comentário