[Tool/Web/Other] Web Based Map Adder [MySQL] [Add/Delete maps from web in server]
#1

Introduction

This is a dynamic map adder that helps you to add or delete maps from web in server. With this you don't need to upload maps as a FilterScript from FTP, you can just simply insert using a webpage. You can delete maps, see map info and add maps from web, and those maps can be loaded in server via a command.


Features
  • Script works both with streamer and without streamer, you don't have to modify script to use streamer functions, if streamer is included script uses streamer functions and if not then it uses SA-MP native functions to create objects.
  • A well designed syntax detection system : While inserting map from web it automatically detect any syntax error and reports it to user.
  • Uses mysqlt_query for all queries in game so does not causes any lag.
  • Easy to delete maps and seeing map info with just one click.

Prerequisites

The php script uses MySqli so you need mysqli for it. In windows it comes with WAMP/XAMPP server. Usually it is automatically installed with MySQL in Linux based system, but if not then ****** is your friend.

The pawn script uses MySQL plugin by BlueG, version r39-2 which can be found here https://sampforum.blast.hk/showthread.php?tid=56564

The pawn script also uses zcmd by Zeex which can be found here : https://sampforum.blast.hk/showthread.php?tid=91354


Demo

Web Demo can be found here : brozeus.tk/plwip.tk/mydemo/mapadder/

In delete page you can see map info by clicking on map name.

In game screenshots:

--

--

--

--

--



Settings

For web based scripts open config.php and edit the code in it.
config.php looks something like this :
PHP Code:
<?php
$mysql_host 
"127.0.0.1";
$mysql_user "root";
$mysql_password "";
$mysql_database "DB_Name";
$server_name "Your Server Name";
$server_logo "Demo Server Logo Here";
?>
For In-game settings edit the #define's at top of pawn script.

It looks something like this :
Code:
#define mysql_host       "127.0.0.1"
#define mysql_user       "root"
#define mysql_password   ""
#define mysql_database   "DB_NAME"

#define AdminCheck(%0) !IsPlayerAdmin(%0)// Method to check if player is admin or not, see below

/*
	Do NOT change the part '#define AdminCheck(%0)', you need to change the part '!IsPlayerAdmin(%0)'
	Example :

		Lets say I have a variable named pInfo[playerid][pAdmin] to check for player admin and I
		want that only admins with admin level 5 or more can use map loading/unloading command.
		So I will do something like this :
		
		    #define AdminCheck(%0) pInfo[%0][pAdmin] < 5
		    
		PS. '%0' is the playerid, use '%0' not playerid in #define
*/


#define MAX_MAPS 100 //max maps that can be loaded at a time in server
Commands

Information of commands that comes with the script and their info are listed below :

Quote:
/mapload
Shows a list of 'UnLoaded' maps from database. After clicking on a map from list its information is shown in a dialog provided with two buttons "Load" and "Cancel". As the name suggest "Load" button loads the map into server.

Quote:
/ml
Short form of command '/mapload'

Quote:
/mapunload
This command is the opposite of '/mapload' command. This command shows a list of 'Loaded' maps. After clicking on a map from list its information is shown in a dialog with two buttons named "UnLoad" and "Cancel". Again as the name suggests 'UnLoad' button unloads the map.

Quote:
/mul
Short form of command '/mapunload'

Download

This project can be downloaded from here : Web Scritps + Pawn Script


Credits

SA-MP Team : For developing and imrpoving SA-MP
Zeex : For zcmd include
BlueG : For MySQL plugin
Bjoern Klinggaard : For bPopup, a javascript based plugin used in webscripts
Alan Williamson : For Line numberer plugin, a javascript based plugin used in webscripts
And I guess me too?


NOTE: The web scripts are not compatible with Internet Explorer.
Reply
#2

Very useful stuff. To bad I can't rep you again....
Reply
#3

You always create Verry Good and Epic Idea but all of times you have bugs
Nvm
Good Job REP+ By Mee
Reply
#4

Cool +1
Reply
#5

https://sampforum.blast.hk/showthread.php?tid=180188 hmm?
btw nice!
Reply
#6

Quote:
Originally Posted by Krisna
View Post
hmm didn't knew something like that already exists, anyways I got the idea from a server I play on and I had a look at that script and it is totally different from mine.
Reply
#7

Awesome script Zeus.
Reply
#8

Awesome!
Reply
#9

Nice script but I got this warnings.

Code:
>> \...\GTA San Andreas\server\filterscripts\Web Map loader_unloader Source\pawn\map.pwn(197) : warning 215: expression has no effect
>> \...\GTA San Andreas\server\filterscripts\Web Map loader_unloader Source\pawn\map.pwn(233) : warning 215: expression has no effect
Reply
#10

Quote:
Originally Posted by Sensation
View Post
Nice script but I got this warnings.

Code:
>> \...\GTA San Andreas\server\filterscripts\Web Map loader_unloader Source\pawn\map.pwn(197) : warning 215: expression has no effect
>> \...\GTA San Andreas\server\filterscripts\Web Map loader_unloader Source\pawn\map.pwn(233) : warning 215: expression has no effect
You can ignore those warnings the script will work fine but if you want a code without warning then you can use this one : http://pastebin.com/3nBuB92h
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)