Some Teleports

Started by Mahmoud Tornado, Sep 11, 2017, 09:22 AM

Previous topic - Next topic

Mahmoud Tornado

Teleports To

Bank
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
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
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
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
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

bro uses something like this is better ;)
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 RP
IP: 51.222.28.159:8194

Mahmoud Tornado

Quote from: Luis_Labarca on Sep 15, 2017, 12:16 AMbro uses something like this is better ;)
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

Somebody please move such posts to the right board...

Mahmoud Tornado

Quote from: Sebastian on Sep 16, 2017, 11:28 PMSomebody please move such posts to the right board...
that was old xDDDDDDDDDDDDDDDDDDDDDDD

Anik

Quote from: Mahmoud Tornado on Sep 17, 2017, 03:00 PM
Quote from: Sebastian on Sep 16, 2017, 11:28 PMSomebody please move such posts to the right board...
that was old xDDDDDDDDDDDDDDDDDDDDDDD
Braindonour

!

Quote from: Mahmoud Tornado on Sep 17, 2017, 03:00 PM]that was old xDDDDDDDDDDDDDDDDDDDDDDD
And this is an old method of increasing post counts.

Discord: zeus#5155

=RK=MarineForce

Quote from: Anik on Sep 17, 2017, 04:28 PM
Quote from: Mahmoud Tornado on Sep 17, 2017, 03:00 PM
Quote from: Sebastian on Sep 16, 2017, 11:28 PMSomebody please move such posts to the right board...
that was old xDDDDDDDDDDDDDDDDDDDDDDD
Braindonour

Nice OLD  Year 1991

Cool

Quote from: zeus on Sep 18, 2017, 04:37 AM
Quote from: Mahmoud Tornado on Sep 17, 2017, 03:00 PM]that was old xDDDDDDDDDDDDDDDDDDDDDDD
And this is an old method of increasing post counts.
Agree, i love my method of increasing my posts :D