Ty <3
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuBans <- ConnectSQL("Bans.db");
QuerySQL(Bans, "CREATE TABLE IF NOT EXISTS Bans(player TEXT, Admin TEXT, Reason TEXT, UID TEXT, UID2 TEXT, IP FLOAT)");
print("Basic ban system has been loaded successfully by gamingpro...");
[/noae]DisconnectSQL( Bans );
[/noae]CheckBan( player ); // Check if player banned or Not.
[/noae]if(cmd == "ban"){
if(!text) MessagePlayer("[#FF0000]Error: [#FFFFFF]Correct Syntax /"+cmd+" <Player> <Reason>",player);
else {
local plr = GetPlayer(GetTok(text, " ",1)),
Reason = GetTok(text, " ",2 NumTok(text, " "));
if(!plr) MessagePlayer("[#FF0000]Error: [#FFFFFF]Unknow Player...",player);
else {
if(!Reason) Reason = "No_Reason"; // here if the admin not giving reason return to No_Reason.
Ban( plr, player.Name, Reason );
}
}
else if(cmd == "unban"){
if(!text) MessagePlayer("[#FF0000]Error: [#FFFFFF]Correct syntax /"+cmd+" <Full-Nick>",player);
else {
local q = QuerySQL(Bans, "SELECT * FROM Bans WHERE player='"+text.tolower()+"'");
if(!q) MessagePlayer("[#FF0000]"+text+" is Not banned yet...",player);
else {
QuerySQL(Bans, "DELETE FROM Bans WHERE player='"+text.tolower()+"'");
ClientMessage("Adminstrator:[ "+player.Name+" ] Unbanned:[ "+text+" ]",player,0,255,0);
}
}
}
else if(cmd == "baninfo"){
if(!text) MessagePlayer("[#FF0000]Error: [#FFFFFF]Correct syntax /"+cmd+" <Full-Nick>",player);
else {
local q = QuerySQL(Bans, "SELECT * FROM Bans WHERE player='"+text.tolower()+"'");
if(!q) MessagePlayer("[#FF0000]"+text+" is Not banned yet...",player);
else {
MessagePlayer("[#00FF00][BAN INFO]: [#FFFFFF]"+text+" Banned Reason:[ "+GetSQLColumnData(q,2)+" ], Admin:[ "+GetSQLColumnData(q,1)+" ]",player);
FreeSQLQuery(q);
}
}
}
}
[/noae]function Ban( banned, admin, reason ){
local nick = banned.Name.tolower();
QuerySQL(Bans, "INSERT INTO Bans(player, Admin, Reason, UID, UID2, IP) VALUES('"+nick+"', '"+admin+"', '"+reason+"', '"+banned.UniqueID+"', '"+banned.UniqueID2+"', '"+banned.IP+"')");
Message("[#db0000]Adminstrator:[#FFFFFF][ "+admin+" ] [#db0000]Banned:[#FFFFFF][ "+banned.Name+" ] [#db0000]For Reason: [#FFFFFF]"+reason);
banned.Kick(); // kicking player.
}
function CheckBan( plr ){
local q = QuerySQL(Bans, "SELECT * FROM Bans WHERE player='"+plr.Name.tolower()+"'");
if(q){
Message("[#FF0000]"+plr.Name+" Banned Reason:[ "+GetSQLColumnData(q,2)+" ] Admin:[ "+GetSQLColumnData(q,1)+" ].");
plr.Kick();
}
else {
local q2 = QuerySQL(Bans, "SELECT * FROM Bans WHERE UID='"+plr.UniqueID+"'");
if(q2){
Message("[#FF0000]"+plr.Name+" Banned Reason:[ "+GetSQLColumnData(q2,2)+" ], Admin:[ "+GetSQLColumnData(q2,1)+" ].");
plr.Kick();
}
else {
local uid2 = QuerySQL(Bans, "SELECT * FROM Bans WHERE UID2='"+plr.UniqueID2+"'");
if(uid2){
Message("[#FF0000]"+plr.Name+" Banned Reason:[ "+GetSQLColumnData(uid2,2)+" ], Admin:[ "+GetSQLColumnData(uid2,1)+" ].");
plr.Kick();
}
else {
local ip = QuerySQL(Bans, "SELECT * FROM Bans WHERE IP='"+plr.IP+"'");
if(ip){
Message("[#FF0000]"+plr.Name+" Banned Reason:[ "+GetSQLColumnData(ip,2)+" ], Admin:[ "+GetSQLColumnData(ip,1)+" ].");
plr.Kick();
}
}
}
}
try
{
FreeSQLQuery(q);
if(q2) FreeSQLQuery(q2);
if(uid2) FreeSQLQuery(uid2);
if(ip) FreeSQLQuery(ip);
}
catch(e)
return false;
}
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();
}
function GetPlayer( target )
{
local target1 = target.tostring();
if ( IsNum( target ) )
{
target = target.tointeger();
if ( FindPlayer( target) ) return FindPlayer( target );
else return null;
}
else if ( FindPlayer( target ) ) return FindPlayer( target );
else return null;
}
[/noae]
rp <- ConnectSQL("Reports.db");
QuerySQL(rp, "CREATE TABLE IF NOT EXISTS Report( plr TEXT, player TEXT, Reason TEXT)");
print("report system has been loaded successfully by gamingpro...");
[/noae]DisconnectSQL( rp );
[/noae]local cmd;
cmd = command.tolower();
if(cmd == "report"){
if(!text) MessagePlayer("[#FF0000]Error: [#FFFFFF]Correct Syntax /"+cmd+" <Player> <Reason>",player);
else {
local plr = GetPlayer(GetTok(text, " ",1));
local reason = GetTok(text, " ",2 NumTok(text, " "));
if(!plr) MessagePlayer("[#FF0000]Error: [#FFFFFF]Unknow player...",player);
else if(plr.Name == player.Name) MessagePlayer("[#FF0000]Error: [#FFFFFF]You can't report your self!.",player);
else {
if(!reason) reason = "No_Reason";
QuerySQL(rp, "INSERT INTO Report(plr,player,Reason) VALUES('"+plr.Name+"', '"+player.Name+"', '"+reason
+"')");
MessagePlayer("[#00FF00][REPORT]: [#FFFFFF]Thank you for your report admins now have notifed!.",player);
Message("[#00FF00][REPORT]: [#FFFFFF]"+player.Name+" Has reported:[ "+plr.Name+" ] For Reason: "+reason);
}
}
}
else if(cmd == "reportlist"){
local q = QuerySQL(rp, "SELECT * FROM Report"), i = 1;
if(!q) MessagePlayer("[#FFFFFF]No players currently have report!.",player);
else {
while( GetSQLColumnData(q,0) != null ){
MessagePlayer("[#00FF00][REPORT]: [#FFFFFF]Reporter:[ "+GetSQLColumnData(q,1)+" ], Suspected:[ "+GetSQLColumnData(q,0)+" ], Reason: "+GetSQLColumnData(q,2),player);
GetSQLNextRow(q);
i++;
}
}
}
[/noae]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();
}
function GetPlayer( target )
{
local target1 = target.tostring();
if ( IsNum( target ) )
{
target = target.tointeger();
if ( FindPlayer( target) ) return FindPlayer( target );
else return null;
}
else if ( FindPlayer( target ) ) return FindPlayer( target );
else return null;
}
[/noae]
SpawnLoc <- ConnectSQL("Spawnloc.db");
QuerySQL(SpawnLoc, "CREATE TABLE IF NOT EXISTS Spawnloc(player TEXT, PX FLOAT, PY FLOAT, PZ FLOAT)");
print("Spawnloc system has been loaded successfully by gamingpro...");
[/noae]local q = QuerySQL(SpawnLoc, "SELECT * FROM Spawnloc WHERE player='"+player.Name+"'");
if(q){
local PX = GetSQLColumnData(q,1),
PY = GetSQLColumnData(q,2),
PZ = GetSQLColumnData(q,3);
MessagePlayer("[#00FF00][SPAWN LOC]: [#FFFFFF]You've spawned with your spawn location.",player);
player.Pos = Vector( PX.tofloat(), PY.tofloat(), PZ.tofloat() );
}
[/noae]local cmd;
cmd = command.tolower();
if(cmd == "spawnloc"){
if(!text) MessagePlayer("[#FF0000]Error: [#FFFFFF]Correct Syntax /"+cmd+" <on/off>",player);
else {
if(text == "off"){
local q = QuerySQL(SpawnLoc, "SELECT * FROM Spawnloc WHERE player='"+player.Name+"'");
if(!q) MessagePlayer("[#FF0000]Error: [#FFFFFF]Your spawn location is already disabled.",player);
else {
QuerySQL(SpawnLoc, "DELETE FROM Spawnloc WHERE player='"+player.Name+"'");
MessagePlayer("[#00FF00][SPAWN LOC]: [#FFFFFF]You've successfully disabled your spawn location",player);
}
}
else if(text == "on"){
local q = QuerySQL(SpawnLoc, "SELECT * FROM Spawnloc WHERE player='"+player.Name+"'");
if(q) MessagePlayer("[#FF0000]Error: [#FFFFFF]Your spawn location is already enabled.",player);
else {
QuerySQL(SpawnLoc, "INSERT INTO Spawnloc(player, PX, PY, PZ) VALUES('"+player.Name+"', '"+player.Pos.x.tofloat()+"', '"+player.Pos.y.tofloat()+"', '"+player.Pos.z.tofloat()+"')");
MessagePlayer("[#00FF00][SPAWN LOC]: [#FFFFFF]Your spawn location has been enabled on!.",player);
}
}
else MessagePlayer("[#FF0000]Error: [#FFFFFF]Use /"+cmd+" <on/off>",player);
}
}
[/noae]
class Spectating
{
isspectating = false;
}
function onScriptLoad(){
spec <- array(GetMaxPlayers(), null);
print("Spectating system has been loaded successfully by gamingpro.");
}
function onPlayerJoin( player ){
spec[player.ID] = Spectating();
}
function onPlayerCommand( player, command, text ){
local cmd;
cmd = command.tolower();
if(cmd == "spec"){
if(player.IsSpawned) ::MessagePlayer("[#FF0000]Error: [#FFFFFF]You must be not spawned before use this command.",player);
else {
if(!text) MessagePlayer("[#FF0000]Error: [#FFFFFF]Correct Syntax /"+cmd+" <player>",player);
else {
local plr = GetPlayer(GetTok(text, " ",1));
if(!plr) ::MessagePlayer("[#FF0000]Error: [#FFFFFF]Unknow player...",player);
else if(plr.Name == player.Name) ::MessagePlayer("[#FF0000]Error: [#FFFFFF]You can't spectating your self!",player);
else if(!plr.IsSpawned) MessagePlayer("[#FF0000]Error: [#FFFFFF]This player isn't spawned yet...",player);
else if(spec[player.ID].isspectating) MessagePlayer("[#FF0000]Error: [#FFFFFF]You're already in spectate, if u want to leave spec use /exitspec",player);
else {
ClientMessage("You're spectating:[ "+plr.Name+" ] Now.",player,0,255,0);
player.SpectateTarget = plr;
spec[player.ID].isspectating = true;
}
}
}
}
else if(cmd == "exitspec"){
if(!spec[player.ID].isspectating) MessagePlayer("[#FF0000]You're not spectating yet...",player);
else {
MessagePlayer("[#00FF00]You've left the spectating.",player);
player.SpectateTarget = false;
}
}
}
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();
}
function GetPlayer( target )
{
local target1 = target.tostring();
if ( IsNum( target ) )
{
target = target.tointeger();
if ( FindPlayer( target) ) return FindPlayer( target );
else return null;
}
else if ( FindPlayer( target ) ) return FindPlayer( target );
else return null;
}
props <- ConnectSQL("props.db");
QuerySQL(props, "CREATE TABLE IF NOT EXISTS prop(ID INTEGER, Price INTEGER, Name TEXT, Owner TEXT, Share TEXT, PX FLOAT, PY FLOAT, PZ FLOAT)");
print("Property System Loaded Succesfully By Gamingpro...");
print("Welcome To Property System....");
print("Maded By:[ gamingpro ]");
LoadProps();
[/noae]if(player.Name == "Vice-Government" || player.Name == "None"){
Message("[#FF0000]Auto-Kicked:[ "+player.Name+" ] Reason:[ Unauthorized Name. ]");
player.Kick();
}
[/noae]if(cmd == "createprop"){
if(player.Name !="gamingpro") MessagePlayer("[#FF0000]Error: [#FFFFFF]You Don't Have Access To Use This Command!",player); // Here You Can To Change This Name To Your Name!
else {
if(!text) MessagePlayer("[#FF0000]Error: [#FFFFFF]Correct Syntax /"+cmd+" <Price> <Prop Name>",player);
else {
local price = GetTok(text, " ",1);
local pname= GetTok(text, " ",2 NumTok(text, " "));
if(!IsNum(price)) MessagePlayer("[#FF0000]Error: [#FFFFFF]Price Must Be Integer.",player);
else if(!pname) MessagePlayer("[#FF0000]Error: [#FFFFFF]Please Write The Name of This Prop!.",player);
else {
local q = QuerySQL(props, "SELECT * FROM prop WHERE Name='"+escapeSQLString(pname)+"'");
if(q) MessagePlayer("[#FF0000]Error: [#FFFFFF]Name Already Exist",player);
else {
local proID = GetSQLColumnData(QuerySQL(props, "SELECT COUNT( * ) FROM prop"),0)+1;
QuerySQL(props, "INSERT INTO prop(ID, Price, Name, Owner, Share, PX, PY, PZ) VALUES('"+proID+"','"+price+"','"+pname+"','Vice-Government','None','"+player.Pos.x.tofloat()+"', '"+player.Pos.y.tofloat()+"','"+player.Pos.z.tofloat()+"')");
CreatePickup( 407, Vector(player.Pos.x.tofloat(), player.Pos.y.tofloat(), player.Pos.z.tofloat() ));
MessagePlayer("[#00ff00]pm >> Successfully Created Prop Name:[ "+pname+" ], ID:[ "+proID+" ], Saved in Database!",player);
}
}
}
}
}
else if(cmd == "buyprop"){
if(!text) MessagePlayer("[#FF0000]Error: [#FFFFFF]Correct Syntax /"+cmd+" <Prop ID>",player);
else {
if(!IsNum(text)) MessagePlayer("[#FF0000]Error: [#FFFFFF]ID Must Be Integer.",player);
else if(text.tointeger() < 1 || text.tointeger() > GetPickupCount() ) MessagePlayer("[#FF0000]Error: [#FFFFFF]Invalid Prop ID, Total Props ID Are "+GetPickupCount(),player);
else {
local q = QuerySQL(props, "SELECT * FROM prop WHERE ID='"+text+"'");
local owner = GetSQLColumnData(q,3);
local price = GetSQLColumnData(q,1);
if(owner != "Vice-Government") MessagePlayer("[#FF0000]Error: [#FFFFFF]This Property is Already Sold!",player);
else if(price > player.Cash) MessagePlayer("[#FF0000]Error: [#FFFFFF]Not Enought Money!",player);
else {
QuerySQL(props, "UPDATE prop SET Owner='"+player.Name+"' WHERE ID='"+text+"'");
MessagePlayer("[#00ff00]You've Bought This Property ID:[ "+text+" ]",player);
Announce("You Have Bought New Prop",player,3);
player.Cash -= price; // Here Add Your remove Cash Function!
}
}
}
}
else if(cmd == "sellprop"){
if(!text) MessagePlayer("[#FF0000]Error: [#FFFFFF]Correct Syntax /"+cmd+" <Prop ID>",player);
else {
if(!IsNum(text)) MessagePlayer("[#FF0000]Error: [#FFFFFF]ID Must Be Integer.",player);
else if(text.tointeger() < 1 || text.tointeger() > GetPickupCount()) MessagePlayer("[#FF0000]Error: [#FFFFFF]Invalid Property ID, Total Props ID Are " + GetPickupCount(),player);
else {
local q = QuerySQL(props, "SELECT * FROM prop WHERE ID='"+text+"'");
local owner = GetSQLColumnData(q,3);
local price = GetSQLColumnData(q,1);
if(owner != player.Name) MessagePlayer("[#FF0000]Error: [#FFFFFF]You Don't Own This Property!",player);
else {
QuerySQL(props, "UPDATE prop SET Owner='Vice-Government', Share='None' WHERE ID='"+text+"'");
MessagePlayer("[#00ff00]pm >> You've Sold This Property ID: " + text,player);
player.Cash += price; // Here Add Your Remove Cash Function!.
Announce("Prop Sold",player,3);
}
}
}
}
else if(cmd == "myprops"){
local q = QuerySQL(props, "SELECT * FROM prop WHERE Owner='"+player.Name+"'"), i = 1;
if(!q) MessagePlayer("[#FFFFFF]You Don't Own Any Property",player);
else {
while( GetSQLColumnData(q,3) == player.Name ){
local id = GetSQLColumnData(q,0);
local name = GetSQLColumnData(q,2);
MessagePlayer("[#00ff00]ID:[ "+id+" ], Name:[ "+name+" ]",player);
GetSQLNextRow(q); i++;
}
}
}
else if(cmd == "mysharedprop" || cmd == "mysharedprops"){
local q = QuerySQL(props, "SELECT * FROM prop WHERE Share='"+player.Name+"'"), i = 1;
if(!q) MessagePlayer("[#FFFFFF]You Don't Own Any Shared Property",player);
else {
while( GetSQLColumnData(q,4) == player.Name ){
local id = GetSQLColumnData(q,0);
local name = GetSQLColumnData(q,2);
local owner = GetSQLColumnData(q,3);
MessagePlayer("[#00ff00]ID:[ "+id+" ], Name:[ "+Name+" ], Owner:[ "+owner+" ]",player);
GetSQLNextRow(q); i++;
}
}
}
else if(cmd == "propsforsale" || cmd == "propforsale" || cmd == "propertyforsalte"){
local q = QuerySQL(props, "SELECT * FROM prop WHERE Owner='Vice-Government'"), i = 1;
if(!q) MessagePlayer("[#FFFFFF]No Any Property For Sale",player);
else {
while( GetSQLColumnData(q,3) == "Vice-Government"){
local id = GetSQLColumnData(q,0);
local price = GetSQLColumnData(q,1);
local name = GetSQLColumnData(q,2);
MessagePlayer("[#00ff00]ID:[ "+id+" ], Price:[ "+price+" ], Name:[ "+name+" ]",player);
GetSQLNextRow(q); i++;
}
}
}
else if(cmd == "shareprop"){
if(!text) MessagePlayer("[#FF0000]Error: [#FFFFFF]Correct Syntax /"+cmd+" <Player> <Prop ID>",player);
else {
local plr = GetPlayer(GetTok(text, " ",1));
local id = GetTok(text, " ",2);
if(!plr) MessagePlayer("[#FF0000]Error: [#FFFFFF]Unknow Player!",player);
else if(plr.Name==player.Name) MessagePlayer("[#FF0000]Error: [#FFFFFF]You Can't Share This prop With Your Self!",player);
else if(!id) MessagePlayer("[#FF0000]Error: [#FFFFFF]Write Property ID You Want To Share it With Him",player);
else if(!IsNum(id)) MessagePlayer("[#FF0000]Error: [#FFFFFF]ID Must Be Integer.",player);
else if(id.tointeger() < 1 || id.tointeger() > GetPickupCount()) MessagePlayer("[#FF0000]Error: [#FFFFFF]Invalid Property ID, Total Props ID Are " + GetPickupCount(),player);
else {
local q = QuerySQL(props, "SELECT * FROM prop WHERE ID='"+id+"'");
local share = GetSQLColumnData(q,4);
local owner = GetSQLColumnData(q,3);
if(owner != player.Name) MessagePlayer("[#FF0000]Error: [#FFFFFF]You Don't Own This Property",player);
else if(share == plr.Name) MessagePlayer("[#FF0000]Error: [#FFFFFF]You're Already Shared This Property With Him!.",player);
else {
QuerySQL(props, "UPDATE prop SET Share='"+plr.Name+"' WHERE ID='"+id+"'");
MessagePlayer("[#00ff00]pm >> You've Shared This Property ID:[ "+id+" ] With " + plr.Name,player);
MessagePlayer("[#00ff00]"+player.Name+" Has Shared Property ID:[ "+id+" ] With You",plr);
}
}
}
}
else if(cmd == "unshareprop"){
if(!text) MessagePlayer("[#FF0000]Error: [#FFFFFF]Correct Syntax /"+cmd+" <Prop ID>",player);
else {
if(!IsNum(text)) MessagePlayer("[#FF0000]Error: [#FFFFFF]ID Must Be Integer.",player);
else if(text.tointeger() < 1 || text.tointeger() > GetPickupCount()) MessagePlayer("[#FF0000]Error: [#FFFFFF]Invalid Property ID, Total Props ID Are " + GetPickupCount(),player);
else {
local q = QuerySQL(props, "SELECT * FROM prop WHERE ID='"+text+"'");
local owner = GetSQLColumnData(q,3);
local share = GetSQLColumnData(q,4);
if(owner != player.Name) MessagePlayer("[#FF0000]Error: [#FFFFFF]You Don't Own This property!.",player);
else if(share == "None") MessagePlayer("[#FF0000]Error: [#FFFFFF]You Don't Shared This Property With Any Player!.",player);
else {
QuerySQL(props, "UPDATE prop SET Share='None' WHERE ID='"+text+"'");
MessagePlayer("[#00ff00]pm >> You've Successfully Un-shared Property ID:[ "+text+" ]",player);
}
}
}
}
else if(cmd == "gotoprop"){
if(!text) MessagePlayer("[#FF0000]Error: [#FFFFFF]Correct Syntax /"+cmd+" <Prop ID>",player);
else {
if(!IsNum(text)) MessagePlayer("[#FF0000]Error: [#FFFFFF]ID Must Be Integer.",player);
else if(text.tointeger() < 1 || text.tointeger() > GetPickupCount()) MessagePlayer("[#FF0000]Error: [#FFFFFF]Invalid Property ID, Total Props ID Are " + GetPickupCount(),player);
else {
local q = QuerySQL(props, "SELECT * FROM prop WHERE ID='"+text+"'");
local owner = GetSQLColumnData(q,3);
local share = GetSQLColumnData(q,4);
if(owner != player.Name && share == player.Name || share != player.Name && owner == player.Name){
local PX = GetSQLColumnData(q,5);
local PY = GetSQLColumnData(q,6);
local PZ = GetSQLColumnData(q,7);
player.Pos = Vector( PX.tofloat(), PY.tofloat(), PZ.tofloat() );
MessagePlayer("[#00ff00]Teleported To Property ID:[ "+text+" ]",player);
}
else {MessagePlayer("[#FF0000]Error: [#FFFFFF]You Don't Own This Property",player);}
}
}
}
else if(cmd == "cmds" || cmd == "commands"){
MessagePlayer("[#00ff00]pm >> Property System Commands is: buyprop, sellprop, shareprop, unshareprop, myprops, mysharedprops, createprop ( For Admins ), gotoprop, propsforsale",player);
}
[/noae]if(pickup.Model == 407){
local id = pickup.ID+1;
local q = QuerySQL(props, "SELECT * FROM prop WHERE ID='"+id+"'");
if(GetSQLColumnData(q,0) != null){
local owner = GetSQLColumnData(q,3),
price = GetSQLColumnData(q,1),
name = GetSQLColumnData(q,2),
share = GetSQLColumnData(q,4);
MessagePlayer("[#00ff00]ID:[ "+id+" ] Owner:[ "+owner+" ] Price:[ "+price+" ] Name:[ "+name+" ] Share:[ "+share+" ]",player);
pickup.RespawnTime = 3000;
}
}
else return;
[/noae]function LoadProps(){
local q = QuerySQL(props, "SELECT * FROM prop"), i = 0;
while( GetSQLColumnData(q,0) ){
local PX = GetSQLColumnData(q,5),
PY = GetSQLColumnData(q,6),
PZ = GetSQLColumnData(q,7);
CreatePickup( 407, Vector(PX.tofloat(), PY.tofloat(), PZ.tofloat() ));
GetSQLNextRow(q); i++;
}
print("Props Loaded: "+i+"");
}
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();
}
function GetPlayer( target )
{
local target1 = target.tostring();
if ( IsNum( target ) )
{
target = target.tointeger();
if ( FindPlayer( target) ) return FindPlayer( target );
else return null;
}
else if ( FindPlayer( target ) ) return FindPlayer( target );
else return null;
}
[/noae]