Help me? - 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: Help me? (
/showthread.php?tid=594596)
Help me? -
sailenin - 20.11.2015
I want a help
-players should not have access to cmds in events(ex.in dms)
example: when a player in dm he can use only /leave and remaining cmds should not work.
Re: Help me? -
Jay_Dixon - 20.11.2015
Use the magic of PVar. Like for example: SetPVarInt(playerid, "InDeathMatch", 1);
then put like:
Код HTML:
if(GetPVarInt(playerid, "InDeathMatch") == 1)//This'll say they're in a deathmatch
{
SendClientMessage(playerid, COLOR HERE, MESSAGE HERE);
return 1;
}
Throughout all the CMD's in the script. Yes it's time consuming. But you'll also have to do it with every other command the other way as well. And let's face it, PVar is much better.
Also after they leave deathMatch, you'll need a DeletePVar(playerid, "InDeathMatch");//This'll delete the PVar
Re: Help me? -
MeCom - 20.11.2015
Код:
new IsPlayerInDM[MAX_PLAYERS];
//if player joins in dm do
IsPlayerInDM[playerid] =1;
//put this code under all your commands except /leave, it checks is player in dm if so then it sends error message else your commadn will work
if(IsPlayerInDM[playerid] == 1) return SendClientMessage(playerid, -1, "error: you cant use this command while deathmatching");
//under /leave command
IsPlayerInDM[playerid] =0;
Edit; i was typing my answer while the guy above posted didnt notice
Re: Help me? -
sailenin - 20.11.2015
Thanks a lot
Re: Help me? -
sailenin - 20.11.2015
one more help
i want to convert SQLite server data to Mysql.( i mean i should take stats from sqlite and store in Mysql).
what should i do?
Re: Help me? -
Jay_Dixon - 20.11.2015
Use BlueG's MySQL r7 if anything. That's the best one in my honest opinion
Re: Help me? -
sailenin - 20.11.2015
Quote:
Originally Posted by Jay_Dixon
Use BlueG's MySQL r7 if anything. That's the best one in my honest opinion
|
Iam using SQlite
and i dont know how to use mysql .so please give me code.
Re: Help me? -
Vince - 20.11.2015
Quote:
Originally Posted by Jay_Dixon
And let's face it, PVar is much better.
|
Easier, perhaps. But not better. They're slower than regular variables. I don't know how much slower as I don't have a benchmark, but it's probably a lot. It is generally discouraged to use them for anything but sharing variables between different scripts.
Quote:
Originally Posted by sailenin
and i dont know how to use mysql
|
You probably should not be using something that you do not understand (just yet). It takes
a lot of time and dedication to learn to understand data models and to learn the Structured Query Language.