Help me?
#1

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.
Reply
#2

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
Reply
#3

Код:
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
Reply
#4

Thanks a lot
Reply
#5

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?
Reply
#6

Use BlueG's MySQL r7 if anything. That's the best one in my honest opinion
Reply
#7

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.
Reply
#8

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)