Szerző Téma: LuxAdmin  (Megtekintve 608 alkalommal)

Nem elérhető Disaster3

  • 2048
  • RyDerBoy96
    • Profil megtekintése
LuxAdmin
« Dátum: 2012. január 30. - 21:16:39 »
0 Show voters
Ezt a scriptet kéne kiegészíteni.  Meg kéne oldani hogy a player lássa a létrehozott telét, és csak azt kezelhesse.
 
//==============================================================================
//Teleport Main
//==============================================================================
if (dialogid == DIALOGID+70)
{
if(response)
{
if(listitem == 0){ ShowPlayerDialog(playerid,DIALOGID+72,DIALOG_STYLE_INPUT,\"Teleport System - Create Teleport\",\"Put in Box the name of new Teleport\",\"Create\",\"Back\");}
//-------------------------------------------
if(listitem == 1)
{
new tcount = 0, tp=0,numrow = 0;
for(new t=0;t<MAX_CTELES;t++)
{
if(CTeleInfo[t][TValid] == 1)
{
numrow++;
}
}
if(numrow > 0)
{
for(new t=0;t<MAX_CTELES;t++)
{
if(CTeleInfo[t][TValid] == 1)
{
format(string,sizeof(string),\"%s %s,\",string,CTeleInfo[t][TName]);
tp++;
if(tp == CTELE_LINE || tcount == numrow-1)
{
strdel(string,strlen(string)-1,strlen(string));
ShowPlayerDialog(playerid,DIALOGID+73,DIALOG_STYLE_INPUT,\"Teleport System - Delete Teleport\",string,\"Delete\",\"Back\");
format(string,sizeof(string),\"%s,\\n\",string,CTeleInfo[t][TName]);
tp = 0;
}
tcount++;
}
}
} else {
GameTextForPlayer(playerid,\"~w~~n~~n~~n~~n~~n~There is ~r~no ~w~Teleport created\",3000,5);
ShowPlayerDialog(playerid,DIALOGID+70,DIALOG_STYLE_LIST,\"LuxAdmin - Teleport System:\",\"Create Tele\\nDelete Tele\\nTeleport\",\"Ok\",\"Cancel\");
}
}
//-------------------------------------------
if(listitem == 2)
{
new tcount = 0, tp=0,numrow = 0;
for(new t=0;t<MAX_CTELES;t++)
{
if(CTeleInfo[t][TValid] == 1)
{
numrow++;
}
}
if(numrow > 0)
{
for(new t=0;t<MAX_CTELES;t++)
{
if(CTeleInfo[t][TValid] == 1)
{
format(string,sizeof(string),\"%s %s,\",string,CTeleInfo[t][TName]);
tp++;
if(tp == CTELE_LINE || tcount == numrow-1)
{
strdel(string,strlen(string)-1,strlen(string));
ShowPlayerDialog(playerid,DIALOGID+71,DIALOG_STYLE_INPUT,\"Teleport System - Teleport:\",string,\"Tele\",\"Back\");
format(string,sizeof(string),\"%s,\\n\",string,CTeleInfo[t][TName]);
tp = 0;
}
tcount++;
}
}
} else {
GameTextForPlayer(playerid,\"~w~~n~~n~~n~~n~~n~There is ~r~no ~w~Teleport created\",3000,5);
ShowPlayerDialog(playerid,DIALOGID+70,DIALOG_STYLE_LIST,\"LuxAdmin - Teleport System:\",\"Create Tele\\nDelete Tele\\nTeleport\",\"Ok\",\"Cancel\");
}
}
}
return 1;
}
//==============================================================================
//Go To Teleport
//==============================================================================
if (dialogid == DIALOGID+71)
{
if(response == 0)
{
ShowPlayerDialog(playerid,DIALOGID+70,DIALOG_STYLE_LIST,\"LuxAdmin - Teleport System:\",\"Create Tele\\nDelete Tele\\nTeleport\",\"Ok\",\"Cancel\");
}
if(response)
{
for(new t=0;t<MAX_CTELES;t++)
{
if(!strlen(inputtext)) return
SendClientMessage(playerid,lightred,\"ERROR: Invalid Telepot!\");
if(CTeleInfo[t][TValid] == 0) return
SendClientMessage(playerid,lightred,\"ERROR: Invalid Telepot!\");
if(strcmp(inputtext,CTeleInfo[t][TName],true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
SetPlayerInterior(playerid, CTeleInfo[t][PosInt]);
LinkVehicleToInterior(GetPlayerVehicleID(playerid), CTeleInfo[t][PosInt]);
SetVehiclePos(GetPlayerVehicleID(playerid),CTeleInfo[t][PosX],CTeleInfo[t][PosY],CTeleInfo[t][PosZ]);
SetVehicleZAngle(GetPlayerVehicleID(playerid),CTeleInfo[t][PosA]);
}
else
{
SetPlayerInterior(playerid, CTeleInfo[t][PosInt]);
SetPlayerPos(playerid,CTeleInfo[t][PosX],CTeleInfo[t][PosY],CTeleInfo[t][PosZ]);
SetPlayerFacingAngle(playerid,CTeleInfo[t][PosA]);
}
format(string,sizeof(string),\"~w~Welcome to ~g~%s\",CTeleInfo[t][TName]);
GameTextForPlayer(playerid,string,2000,5);
return 1;
}
}
}
return 1;
}
//==============================================================================
//Create Teleport
//==============================================================================
if (dialogid == DIALOGID+72)
{
if(response == 0)
{
ShowPlayerDialog(playerid,DIALOGID+70,DIALOG_STYLE_LIST,\"LuxAdmin - Teleport System:\",\"Create Tele\\nDelete Tele\\nTeleport\",\"Ok\",\"Cancel\");
}
if(response)
{
for(new t=0;t<MAX_CTELES;t++)
{
if(!strlen(inputtext)) return
SendClientMessage(playerid,lightred,\"ERROR: Invalid Telepot!\");
if(CTeleInfo[t][TValid] == 1)
{
if(strcmp(inputtext,CTeleInfo[t][TName],true) == 0)
{
SendClientMessage(playerid,lightred,\"ERROR: Teleportation already exist!\");
return 1;
}
}
new Float:x,Float:y,Float:z,Float:a;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
if(CTeleInfo[t][TValid] == 0)
{
CTeleInfo[t][PosX] = x;
CTeleInfo[t][PosY] = y;
CTeleInfo[t][PosZ] = z;
CTeleInfo[t][PosA] = a;
CTeleInfo[t][PosInt] = GetPlayerInterior(playerid);
CTeleInfo[t][TValid] = 1;
strmid(CTeleInfo[t][TName],inputtext,0,strlen(inputtext),30);
GameTextForPlayer(playerid,\"~w~~n~~n~~n~~n~~n~Teleport ~g~Created!\",3000,5);
SaveTeleport();
ShowPlayerDialog(playerid,DIALOGID+70,DIALOG_STYLE_LIST,\"LuxAdmin - Teleport System:\",\"Create Tele\\nDelete Tele\\nTeleport\",\"Ok\",\"Cancel\");
new sstring[256];
format(sstring, sizeof(sstring), \"(Created) Tele: %s, Pos: X: %f,Y: %f,Z: %f,Ang:%f,Interior:%d\",CTeleInfo[t][TName],CTeleInfo[t][PosX],CTeleInfo[t][PosY],CTeleInfo[t][PosZ],CTeleInfo[t][PosA],CTeleInfo[t][PosInt]);
SaveIn(\"TelesLog\",sstring);
return 1;
}
}
}
return 1;
}
//==============================================================================
//Delete Teleport
//==============================================================================
if (dialogid == DIALOGID+73)
{
if(response == 0)
{
ShowPlayerDialog(playerid,DIALOGID+70,DIALOG_STYLE_LIST,\"LuxAdmin - Teleport System:\",\"Create Tele\\nDelete Tele\\nTeleport\",\"Ok\",\"Cancel\");
}
if(response)
{
for(new t=0;t<MAX_CTELES;t++)
{
if(!strlen(inputtext)) return
SendClientMessage(playerid,lightred,\"ERROR: Invalid Telepot!\");
if(CTeleInfo[t][TValid] == 1)
{
if(strcmp(inputtext,CTeleInfo[t][TName],true) == 0)
{
CTeleInfo[t][TValid] = 0;
CTeleInfo[t][PosX] = 0;
CTeleInfo[t][PosY] = 0;
CTeleInfo[t][PosZ] = 0;
CTeleInfo[t][PosA] = 0;
CTeleInfo[t][PosInt] = 0;
GameTextForPlayer(playerid,\"~w~~n~~n~~n~~n~~n~Teleport ~r~Deleted!\",3000,5);
SaveTeleport();
ShowPlayerDialog(playerid,DIALOGID+70,DIALOG_STYLE_LIST,\"LuxAdmin - Teleport System:\",\"Create Tele\\nDelete Tele\\nTeleport\",\"Ok\",\"Cancel\");
new sstring[256];
format(sstring, sizeof(sstring), \"(Deleted) Tele: %s\",CTeleInfo[t][TName]);
SaveIn(\"TelesLog\",sstring);
return 1;
}
}
}
}
return 1;
}
#endif
//==============================================================================

 
Elõre is köszönöm!
Téma neve nem jó.Javítsd
« Utoljára szerkesztve: 2012. január 31. - 17:31:46 írta RyDerBoy96 »

Nem elérhető instant

  • 2778
  • ZzzzzZ
    • Profil megtekintése
LuxAdmin
« Válasz #1 Dátum: 2012. január 31. - 14:45:40 »
0 Show voters
és mit kell benne kiegésziteni ?

Nem elérhető Disaster3

  • 2048
  • RyDerBoy96
    • Profil megtekintése
LuxAdmin
« Válasz #2 Dátum: 2012. január 31. - 17:08:00 »
0 Show voters
Levan írva.

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal