Help please.
#1

Making a filterscript that alows you to create org's simply.
Ran into an error on the process and wondering if someone could help.
So, once i type my command, i't doesnt show the name or save the name, everything else save's fine.
Heres my code :

Код:
dcmd_createorg(playerid, params[])
{
	new tmp1[256], tmp2[256], tmp3[256], tmp4[256],Index;
	tmp1 = strtok(params,Index);
	tmp2 = strtok(params,Index);
	tmp3 = strtok(params,Index);
	tmp4 = strtok(params,Index);
	
	new name = strval(tmp1);
	new color = strval(tmp2);
	new weap1 = strval(tmp3);
	new weap1_ammo = strval(tmp4);
	
	if (IsPlayerAdmin(playerid))
	{
	  if (strlen(tmp1) && strlen(tmp2) && strlen(tmp3) && strlen(tmp4))
	  {
	    new oName[64];
			format(oName, 64, "%s", name);

	    new org[256];
			format(org, sizeof(org), "\\organizations\\%s.ini", oName);
			
			if (!dini_Exists(org))
			{
				dini_Create(org);
				dini_Set(org, "Name", oName);
				dini_IntSet(org, "Color", color);
				dini_IntSet(org, "Weapon1", weap1);
				dini_IntSet(org, "Weapon1_Ammo", weap1_ammo);
			}

	    new string[256];
	    format(string, sizeof(string), "~ You have created '%s'.", oName);
	    SendClientMessage(playerid, COLOR_ORANGE, string);
	  }
	  else
	  {
	    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /createorg [name] [color id] [weapon1] [weapon1 ammo]");
		}
	}
	else
	{
		return 0;
	}
	return 1;
}
Thanks
Reply


Messages In This Thread
Help please. - by Anwix - 08.08.2009, 18:25
Re: Help please. - by Doppeyy - 09.08.2009, 02:22
Re: Help please. - by SampStunta - 09.08.2009, 02:38
Re: Help please. - by tanush - 24.05.2010, 03:43
Re: Help please. - by Doppeyy - 20.06.2010, 22:54

Forum Jump:


Users browsing this thread: 1 Guest(s)