Commit 52cb27ca authored by Whice's avatar Whice

Spieler teleport Funktion

- Funktion um Spieler zu teleportieren (mit oder ohne Fahrzeug, in Interiors, etc.) implementiert
parent 42cb347c
......@@ -73,7 +73,11 @@ enum PlayerInfo {
pInventory,
bool:pLogged,
pInt,
pVWord
pVWord,
Float:pPosX,
Float:pPosY,
Float:pPosZ,
Float:pPosR
};
new pInfo[MAX_PLAYERS][PlayerInfo];
......@@ -94,7 +98,11 @@ enum {
D_STATS,
D_CREATEINT,
D_INTNAME,
D_INTMODEL
D_INTMODEL,
D_TELES,
D_TELES_LS,
D_TELES_SF,
D_TELES_LV
};
// Interior Variablen
......@@ -422,7 +430,7 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
return 1;
}
case D_CREATEINT: {
if(!response) return 1;
if(!response) return SendClientMessage(playerid, COLOR_WHITE, "=> Das Men kann jederzeit wieder geffnet werden (/createInterior)");
switch(listitem) {
case 0: { // Spawn auen
new Float:Pos[4];
......@@ -608,6 +616,41 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
SetPVarString(playerid, "INT_NAME", inputtext);
SendClientMessage(playerid, COLOR_WHITE, "=> Der Name fr das Interior wurde gesetzt!");
}
case D_TELES: {
if(!response) return 1;
switch(listitem) {
case 0: {
// Los Santos
ShowPlayerDialog(playerid, D_TELES_LS, DIALOG_STYLE_LIST, D_WHITE"Teleporations-Liste - Los Santos", D_WHITE"LSPD\nAmmunation\nBSN (Burger Shot North)", D_WHITE"Teleportieren", D_WHITE"Zurck");
}
case 1: {
// San Fierro
}
case 2: {
// Las Venturas
}
}
return 1;
}
case D_TELES_LS: {
if(!response) return ShowPlayerDialog(playerid, D_TELES, DIALOG_STYLE_LIST, D_WHITE"Teleporations-Liste", D_WHITE"Los Santos\nSan Fierro\nLas Venturas", D_WHITE"Teleportieren", D_WHITE"Abbrechen");
switch(listitem) {
case 0: {
// LSPD
SetPosition(playerid, 1538.4631, -1673.4545, 13.5469, 319.1514, 0, 0, true);
SendClientMessage(playerid, COLOR_WHITE, "=> Du hast dich zum LSPD teleportiert!");
}
case 1: {
// Ammunation
SetPosition(playerid, 1360.8120, -1283.4692, 13.3825, 359.1666, 0, 0, true);
SendClientMessage(playerid, COLOR_WHITE, "=> Du hast dich zum Ammunation teleportiert!");
}
case 2: {
// BSN
}
}
return 1;
}
}
return 1;
}
......@@ -918,10 +961,10 @@ CMD:ahelp(playerid, params[]) {
}
CMD:enter(playerid, params[]) {
if(IsPlayerInAnyVehicle(playerid)) return SendErrorMessage(playerid, "Du darfst in keinem Fahrzeug sein!");
if(pInfo[playerid][pInt] != 0 || pInfo[playerid][pVWord] != 0) return SendErrorMessage(playerid, "Du darfst dazu in keinem Interior sein!");
for(new i = 0; i < sizeof(intInfo); i++) {
if(!IsPlayerInRangeOfPoint(playerid, 3.0, intInfo[i][intOuterPickupX], intInfo[i][intOuterPickupY], intInfo[i][intOuterPickupZ])) continue;
if(IsPlayerInAnyVehicle(playerid)) return SendErrorMessage(playerid, "Du darfst in keinem Fahrzeug sein!");
//FreezePlayer(playerid);
SetInterior(playerid, intInfo[i][intInterior]);
SetVirtualWorld(playerid, intInfo[i][intVWorld]);
......@@ -939,6 +982,7 @@ CMD:exit(playerid, params[]) {
if(pInfo[playerid][pInt] == 0 || pInfo[playerid][pVWord] == 0) return SendErrorMessage(playerid, "Du musst dazu in einem Interior sein!");
for(new i = 0; i < sizeof(intInfo); i++) {
if(!IsPlayerInRangeOfPoint(playerid, 3.0, intInfo[i][intInnerPickupX], intInfo[i][intInnerPickupY], intInfo[i][intInnerPickupZ])) continue;
if(IsPlayerInAnyVehicle(playerid)) return SendErrorMessage(playerid, "Du darfst in keinem Fahrzeug sein!");
FreezePlayer(playerid);
SetPlayerPos(playerid, intInfo[i][intOuterSpawnX], intInfo[i][intOuterSpawnY], intInfo[i][intOuterSpawnZ]);
SetPlayerFacingAngle(playerid, intInfo[i][intOuterSpawnR]);
......@@ -999,6 +1043,7 @@ CMD:int(playerid, params[]) {
new interID;
if(sscanf(params, "d", interID)) return SendErrorMessage(playerid, "Benutzung: /int [Interior-ID]");
SetPlayerPos(playerid, intInfo[interID][intOuterSpawnX], intInfo[interID][intOuterSpawnY], intInfo[interID][intOuterSpawnZ]);
SetPlayerFacingAngle(playerid, intInfo[interID][intOuterSpawnR]);
return 1;
}
......@@ -1016,4 +1061,61 @@ CMD:ints(playerid, params[]) {
CMD:unfreeze(playerid, params[]) {
return UnFreezePlayer(playerid);
}
CMD:teles(playerid, params[]) {
if(GetAdmin(playerid) < 1) return NO_PERM;
ShowPlayerDialog(playerid, D_TELES, DIALOG_STYLE_LIST, D_WHITE"Teleporations-Liste", D_WHITE"Los Santos\nSan Fierro\nLas Venturas", D_WHITE"Teleportieren", D_WHITE"Abbrechen");
return 1;
}
CMD:maketrailer(playerid, params[]) {
new trailer;
if(sscanf(params, "d", trailer)) return SendErrorMessage(playerid, "Benutzung: /maketrailer [Vehicle-ID]");
AttachTrailerToVehicle(trailer, GetPlayerVehicleID(playerid));
return 1;
}
stock SetPosition(playerid, Float:x, Float:y, Float:z, Float:r, interiorid = 0, virtualWorld = 0, bool:withVehicle = false) {
if(withVehicle && IsPlayerInAnyVehicle(playerid)) {
// Mit Fahrzeug
new seat = GetPlayerVehicleSeat(playerid),
veh = GetPlayerVehicleID(playerid),
trailer = GetVehicleTrailer(veh);
pInfo[playerid][pPosX] = x;
pInfo[playerid][pPosY] = y;
pInfo[playerid][pPosZ] = z;
pInfo[playerid][pPosR] = r;
pInfo[playerid][pInt] = interiorid;
pInfo[playerid][pVWord] = virtualWorld;
SetPlayerInterior(playerid, interiorid);
SetPlayerVirtualWorld(playerid, virtualWorld);
SetPlayerPos(playerid, pInfo[playerid][pPosX], pInfo[playerid][pPosY], pInfo[playerid][pPosZ] + 5);
SetPlayerFacingAngle(playerid, pInfo[playerid][pPosR]);
if(trailer != 0) {
LinkVehicleToInterior(trailer, interiorid);
SetVehicleVirtualWorld(trailer, virtualWorld);
SetVehiclePos(trailer, pInfo[playerid][pPosX], pInfo[playerid][pPosY], pInfo[playerid][pPosZ] + 5);
}
LinkVehicleToInterior(veh, interiorid);
SetVehicleVirtualWorld(veh, virtualWorld);
SetVehiclePos(veh, pInfo[playerid][pPosX], pInfo[playerid][pPosY], pInfo[playerid][pPosZ]);
PutPlayerInVehicle(playerid, veh, seat);
if(trailer != 0) AttachTrailerToVehicle(trailer, veh);
} else {
// Ohne Fahrzeug
pInfo[playerid][pPosX] = x;
pInfo[playerid][pPosY] = y;
pInfo[playerid][pPosZ] = z;
pInfo[playerid][pPosR] = r;
pInfo[playerid][pInt] = interiorid;
pInfo[playerid][pVWord] = virtualWorld;
SetPlayerInterior(playerid, interiorid);
SetPlayerVirtualWorld(playerid, virtualWorld);
SetPlayerPos(playerid, pInfo[playerid][pPosX], pInfo[playerid][pPosY], pInfo[playerid][pPosZ]);
SetPlayerFacingAngle(playerid, pInfo[playerid][pPosR]);
}
return 1;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment