Renaming a Dynamic Door
#1

So I have this:

Код:
	else if(strcmp(params, "name", true) == 0)
	{
		format(DDoorsInfo[doorid][ddDescription], 128, "%s", doorname);
		SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have changed the name of the door!");
		if(IsValidDynamicPickup(DDoorsInfo[doorid][ddPickupID])) DestroyDynamicPickup(DDoorsInfo[doorid][ddPickupID]);
		if(IsValidDynamic3DTextLabel(DDoorsInfo[doorid][ddTextID])) DestroyDynamic3DTextLabel(DDoorsInfo[doorid][ddTextID]);
		CreateDynamicDoor(doorid);
	}
Its on my /dooredit command, you can do /dooredit name and then changed the name to whatever you enter, although im having problems

It probably wont work in a strcmp or w/e

So could someone make a /doorname [doorid] [namehere] CMD for me please?

I tried to do one but it never changed the name of the dynamic door

thanks +rep to anyone who can help
Reply
#2

the problem is exactly at strmp that you use,what it does is that it checks if they exactly write "name" or not(the word of name in stead of an string)
using sscanf and yCMD:
Код:
CMD:doorname(playerid, params[])
{
	if(sscanf(params, "ds", doorid, doorname) return SendClientMessage(playerid, color, "/doorname [doorid] [name]
	if(doorid == 1)//this is the format that u must use:if(doorid == x)
	{
	    new path[100]
	    format(path,sizeof(path),"/doors/door %d.ini", doorid);
	    Update3DTextLabelText(doorid, color, doorname);
	    dini_Set(path,"doorname",doorname);
	}
}
I hope this helps
if you need further help about it feel free to PM me
Reply
#3

Could you make it Y_INI please as thats what im using to save everything!
Reply
#4

ini_WriteString(path,"doorname", doorname);
^^
Reply
#5

still returns the command and does nothing ;/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)