SA-MP Forums Archive
Renaming a Dynamic Door - 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: Renaming a Dynamic Door (/showthread.php?tid=378432)



Renaming a Dynamic Door - RLGaming - 17.09.2012

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


AW: Renaming a Dynamic Door - arvifilter - 18.09.2012

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


Re: Renaming a Dynamic Door - RLGaming - 18.09.2012

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


Re: Renaming a Dynamic Door - arvifilter - 18.09.2012

ini_WriteString(path,"doorname", doorname);
^^


Re: Renaming a Dynamic Door - RLGaming - 18.09.2012

still returns the command and does nothing ;/