Help please. -
Anwix - 08.08.2009
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
Re: Help please. -
Doppeyy - 09.08.2009
maybey you can post the error to ?
would be a little easyier to look for the mistake
![rolleyes](images/smilies/rolleyes.gif)
i know im lazy
Gr Artix
Re: Help please. -
SampStunta - 09.08.2009
I compiled this on my computer and it went well...
dcmd_createorg(playerid, params[])
{
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);
name = strval(tmp1);
color = strval(tmp2);
weap1 = strval(tmp3);
weap1_ammo = strval(tmp4);
(IsPlayerAdmin(playerid))
{
(strlen(tmp1) && strlen(tmp2) && strlen(tmp3) && strlen(tmp4))
{
if oName[64];
format(oName, 64, "%s", name);
if org[256];
format(org, sizeof(org), "\\organizations\\%s.ini", oName);
(!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);
}
string[256];
format(string, sizeof(string), oName);
SendClientMessage(playerid, ORANGE, "You have created '%s'.");
}
else
{
SendClientMessage(playerid, WHITE, "USAGE: /createorg [name] [color id] [weapon1] [weapon1 ammo]");
}
}
else
{
return 1;
}
return 0;
}
If it says 1 Error still close the compiler thing and open where you saved it to and it still should be there
I swapped some things around to make it right!
Re: Help please. -
tanush - 24.05.2010
where do i put that in my script?
Re: Help please. -
Doppeyy - 20.06.2010
Quote:
Originally Posted by tanush
where do i put that in my script?
|
Make something of your own.
Dont steal other peoples idea's.
[Doppeyy