Some Teleports

Mahmoud Tornado

  • Full Member
  • Posts: 220
Some Teleports
« on September 11th, 2017, 10:22 AM »
Teleports To

Bank
Code: [Select]
else if ( cmd == "bank" )
{
          if ( !player.IsSpawned ) MessagePlayer( "You haven't spawned yet..", player );
            else
               {
                  player.Pos = Vector(-905.473022460938, -341.132446289063, 13.3801584243774 );
                  MessagePlayer( "[#ffbb00]*** Teleport Done To Bank Zone ***", player );               
                }
         }

Airport
Code: [Select]
else if ( cmd == "airport" )
{
          if ( !player.IsSpawned ) PrivMessage( "You haven't spawned yet..", player );
            else
               {
                  player.Pos = Vector(-1684.91809082031, -922.396728515625, 28.6625099182129 );
                  MessagePlayer( "[#ffbb00]*** Teleport Done To The Airport ***", player );               
                }
         }

Ocean View Hotel
Code: [Select]
else if ( cmd == "hotel" )
{
          if ( !player.IsSpawned ) PrivMessage( "You haven't spawned yet..", player );
            else
               {
                  player.Pos = Vector(225.674163818359, -1277.91491699219, 12.0746984481812 );
                  MessagePlayer( "[#ffbb00]*** Teleport Done To Ocean View Hotel ***", player );               
                }
         }

Light House
Code: [Select]
else if ( cmd == "lighthouse" )
{
          if ( !player.IsSpawned ) PrivMessage( "You haven't spawned yet..", player );
            else
               {
                  player.Pos = Vector(225.674163818359, -1277.91491699219, 12.0746984481812 );
                  MessagePlayer( "[#ffbb00]*** Teleport Done To Ocean View Hotel ***", player );               
                }
         }

Villa In NBeachbt
Code: [Select]
else if ( cmd == "villa" )
{
          if ( !player.IsSpawned ) PrivMessage( "You haven't spawned yet..", player );
            else
               {
                  player.Pos = Vector(416.483, 655.663, 11.3 );
                  MessagePlayer( "[#ffbb00]*** Teleport Done To Villa. Enjoy! ***", player );               
                }
         }

Luis_Labarca

  • Sr. Member
  • Hello :D
  • Posts: 298
Re: Some Teleports
« Reply #1, on September 15th, 2017, 01:16 AM »
bro uses something like this is better ;)
Code: [Select]
function onScriptLoad()
{
DataBase<- ConnectSQL( "DataBase.db" );
QuerySQL( DataBase, "CREATE TABLE IF NOT EXISTS Saveloc (NameLoc TEXT,Creator TEXT, X FLOAT, Y FLOAT, Z FLOAT )" );
}

function onPlayerCommand ( player , cmd , text )
{
cmd = cmd.tolower ( );
if ( cmd == "saveloc" )
{
local q = QuerySQL(DataBase, "SELECT * FROM Saveloc WHERE NameLoc='" + text + "'");
if ( !text ) MessagePlayer("[#FFD700]Use: /"+cmd+" [Loc]", player );
else if ( FindLoc( GetTok( text, " ", 1 ) ) ) MessagePlayer("[#ADFF2F]Loc Name it already exists", player );
else {
SaveLoc( player, text );
}
}
else if ( cmd == "gotoloc" )
{
local q = QuerySQL(DataBase, "SELECT * FROM Saveloc WHERE NameLoc='" + text + "'");
if ( !text ) MessagePlayer("[#FFD700]Use: /"+cmd+" [ Loc ]", player );
else if ( !FindLoc( GetTok( text, " ", 1 ) ) ) MessagePlayer( "[#FFD700] LocName : "+text+" Does not exist.", player );
else {
local Loc = text;
local Name = QuerySQL( DataBase, "SELECT NameLoc, Creator, X, Y, Z FROM Saveloc WHERE NameLoc='"+Loc+"'" );
local LName = GetSQLColumnData( Name, 0 );
local Creator = GetSQLColumnData( Name, 1 );
local X = GetSQLColumnData( Name, 2 );
local Y = GetSQLColumnData( Name, 3 );
local Z = GetSQLColumnData( Name, 4 );
player.Pos = Vector( X, Y, Z );
MessagePlayer("[#ADFF2F]Teleport to the [#4682B4]Loc Name :"+LName+"[#ffffff] Creator : "+Creator, player );
}
}
}
function SaveLoc( player, NameLocLugar )
{
local Loc = NameLocLugar;
local Pos = player.Pos;
QuerySQL( DataBase, "INSERT INTO Saveloc( NameLoc, Creator, X, Y, Z ) VALUES ( '" + Loc + "', '" + player.Name + "', '" + Pos.x + "', '" + Pos.y + "', '" + Pos.z + "')" );
MessagePlayer("[#ADFF2F]Saveloc:[ "+NameLocLugar+" ].", player );
}
function FindLoc( LugarNameLoc )
{
local Name = QuerySQL( DataBase, "SELECT NameLoc FROM Saveloc WHERE NameLoc='" + LugarNameLoc + "'" );
local LName = GetSQLColumnData( Name, 0 );
return LName;
FreeSQLQuery( Name );
}
function GetTok(string, separator, n, ...)
{
local m = vargv.len() > 0 ? vargv[0] : n,
tokenized = split(string, separator),
text = "";
if (n > tokenized.len() || n < 1) return null;
for (; n <= m; n++)
{
text += text == "" ? tokenized[n-1] : separator + tokenized[n-1];
}
return text;
}
function NumTok(string, separator)
{
local tokenized = split(string, separator);
return tokenized.len();
}
My server ...:: RPG ::...
IP: 149.56.143.129:8195

Mahmoud Tornado

  • Full Member
  • Posts: 220
Re: Some Teleports
« Reply #2, on September 15th, 2017, 11:37 AM »
Quote from Luis_Labarca on September 15th, 2017, 01:16 AM
bro uses something like this is better ;)
Code: [Select]
function onScriptLoad()
{
DataBase<- ConnectSQL( "DataBase.db" );
QuerySQL( DataBase, "CREATE TABLE IF NOT EXISTS Saveloc (NameLoc TEXT,Creator TEXT, X FLOAT, Y FLOAT, Z FLOAT )" );
}

function onPlayerCommand ( player , cmd , text )
{
cmd = cmd.tolower ( );
if ( cmd == "saveloc" )
{
local q = QuerySQL(DataBase, "SELECT * FROM Saveloc WHERE NameLoc='" + text + "'");
if ( !text ) MessagePlayer("[#FFD700]Use: /"+cmd+" [Loc]", player );
else if ( FindLoc( GetTok( text, " ", 1 ) ) ) MessagePlayer("[#ADFF2F]Loc Name it already exists", player );
else {
SaveLoc( player, text );
}
}
else if ( cmd == "gotoloc" )
{
local q = QuerySQL(DataBase, "SELECT * FROM Saveloc WHERE NameLoc='" + text + "'");
if ( !text ) MessagePlayer("[#FFD700]Use: /"+cmd+" [ Loc ]", player );
else if ( !FindLoc( GetTok( text, " ", 1 ) ) ) MessagePlayer( "[#FFD700] LocName : "+text+" Does not exist.", player );
else {
local Loc = text;
local Name = QuerySQL( DataBase, "SELECT NameLoc, Creator, X, Y, Z FROM Saveloc WHERE NameLoc='"+Loc+"'" );
local LName = GetSQLColumnData( Name, 0 );
local Creator = GetSQLColumnData( Name, 1 );
local X = GetSQLColumnData( Name, 2 );
local Y = GetSQLColumnData( Name, 3 );
local Z = GetSQLColumnData( Name, 4 );
player.Pos = Vector( X, Y, Z );
MessagePlayer("[#ADFF2F]Teleport to the [#4682B4]Loc Name :"+LName+"[#ffffff] Creator : "+Creator, player );
}
}
}
function SaveLoc( player, NameLocLugar )
{
local Loc = NameLocLugar;
local Pos = player.Pos;
QuerySQL( DataBase, "INSERT INTO Saveloc( NameLoc, Creator, X, Y, Z ) VALUES ( '" + Loc + "', '" + player.Name + "', '" + Pos.x + "', '" + Pos.y + "', '" + Pos.z + "')" );
MessagePlayer("[#ADFF2F]Saveloc:[ "+NameLocLugar+" ].", player );
}
function FindLoc( LugarNameLoc )
{
local Name = QuerySQL( DataBase, "SELECT NameLoc FROM Saveloc WHERE NameLoc='" + LugarNameLoc + "'" );
local LName = GetSQLColumnData( Name, 0 );
return LName;
FreeSQLQuery( Name );
}
function GetTok(string, separator, n, ...)
{
local m = vargv.len() > 0 ? vargv[0] : n,
tokenized = split(string, separator),
text = "";
if (n > tokenized.len() || n < 1) return null;
for (; n <= m; n++)
{
text += text == "" ? tokenized[n-1] : separator + tokenized[n-1];
}
return text;
}
function NumTok(string, separator)
{
local tokenized = split(string, separator);
return tokenized.len();
}
Thx I Added One But That Was Old :D And Thx For Your Help. :D

Sebastian

  • VC:MP Beta Tester
  • Something like this: hga hga hga
  • Posts: 917
Re: Some Teleports
« Reply #3, on September 17th, 2017, 12:28 AM »
Somebody please move such posts to the right board...

Mahmoud Tornado

  • Full Member
  • Posts: 220

Anik

  • Sr. Member
  • Posts: 355

!

  • Sr. Member
  • Don't feel shy while zooming on h*r... >>zeus#5155
  • Posts: 380

Discord: zeus#5155

=RK=MarineForce

  • Sr. Member
  • WAR IS HELL!
  • Posts: 447
Try to UnderStand ME!

Cool

  • Hero Member
  • Posts: 719