Questions
#1

Hello I'm Uberanwar I want to ask some questions..

1. How to convert commands alot faster? I've like 50 commands - I've strcmp cmds, i want to convert it to dcmd
(a) Do I've to put DCMD commands under onplayercommandtext

(b) What do I've to change in this code, to convert it to dcmd?

Quote:
Код:
    if(strcmp(cmd, "/register", true) == 0)
	{
	    tmp = strtok(cmdtext, idx);
	    if(strlen(tmp) == 0) return SendClientMessage(playerid, ERROR, "Use: /register [PASSWORD]");
	    format(file,sizeof(file),"%s.dudb.sav", name);
	    if(!fexist(file))
		{
			dini_Create(file);
			dini_IntSet(file, "Password", udb_hash(tmp));
			dini_IntSet(file, "Money", 2500);
			dini_IntSet(file, "Score", 1);
			dini_IntSet(file, "Bank", 1000);
			dini_IntSet(file, "RobSkill", 1);
			dini_IntSet(file, "TerSkill", 1);
			dini_IntSet(file, "WantedLevel", 0);
			dini_IntSet(file, "Jail", 0);
			dini_IntSet(file, "RentalOwner", 0);
			dini_IntSet(file, "Drugs", 0);
			dini_IntSet(file, "C4", 0);
			dini_IntSet(file, "Skin", -1);
			SendClientMessage(playerid, GREY, "Thanks for registering!");
			SendClientMessage(playerid, GREY, "You may now login.");
			SendClientMessage(playerid, GREY, "To do so, type: /login [PASSWORD]");
			GameTextForPlayer(playerid, "~r~Registered!", 3000, 1);
		}
		else SendClientMessage(playerid, ERROR, "This account is already registered in our system. Use: /login [PASSWORD]");
		return true;
	}

2. How do I check if my script is laggy, like it's performance?

3. Is there any tips for optimizing script?
Reply
#2

Quote:
Originally Posted by Uberanwar
Посмотреть сообщение
3. Is there any tips for optimizing script?
Don't use dcmd.
Reply
#3

Quote:
Originally Posted by thefatshizms
Посмотреть сообщение
Don't use dcmd.
Uhh, I need to convert the strcmp commands to dcmd for some reasons
Reply
#4

Use zcmd instead.
Reply
#5

Sorry, I prefer DCMD. I just want to convert them from strcmp to dcmd,
Reply
#6

Quote:
Originally Posted by Uberanwar
Посмотреть сообщение
Sorry, I prefer DCMD. I just want to convert them from strcmp to dcmd,
You're asking for tips on optimization yet you wan't to use the worst command processors made.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)