Any ideas regarding a way to create this function/idea? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Any ideas regarding a way to create this function/idea? (
/showthread.php?tid=406644)
Any ideas regarding a way to create this function/idea? -
RajatPawar - 11.01.2013
Hello guys. I have coordinates for some gang zones I created and I am thinking of making gang zones, and saving them using MySQL, with names (Say, the gang zone near the PD = PDGang_Zone). You could get the name using a stock GetNameOfGangZone. And then a player could /take the gangzone for themselves, which would set the 'controlled' field in the mysql table to 1.
That's all easy, but the stock and setting names for the zones and actually getting them is difficult/I have no idea on how to do it. Can you'all please provide some? I thought of using an array, but it would be hard to pin point specific zones out of it.
Re: Any ideas regarding a way to create this function/idea? -
mineralo - 11.01.2013
make a table in database like
PHP код:
DROP TABLE IF EXISTS `gangzones`;
CREATE TABLE IF NOT EXISTS `gangzones` (
`ID` int(11) NOT NULL,
`Description` varchar(20) COLLATE utf8_bin NOT NULL DEFAULT '',
`X` varchar(20) NOT NULL DEFAULT '0.0000',//its on string, its better to work in string than float, some issues happening when use float in mysql
`Y` varchar(20) NOT NULL DEFAULT '0.0000',
`cX` varchar(20) NOT NULL DEFAULT '0.0000',
`cY` varchar(20) NOT NULL DEFAULT '0.0000',
`Owned` varchar(20) NOT NULL DEFAULT '0',
UNIQUE KEY `ID` (`ID`)
);
and after make a public which on gm on load them, and on gm off save it into mysql, also make a function like to save id of gangzone like SaveGangZone(id), rest go on