help about clan -
mehdimmz - 01.11.2014
hi to all dears
i have a problem
i made this cmd
PHP Code:
dcmd_clan(playerid,params[])
{
new string[128];
new name;
if(sscanf(params, "s",name))
{
SendClientMessage(playerid,COLOR_ERROR,"Pls Use /Clan [Name]");
return 1;
}
if(Clan[playerid] != 0)
{
SendClientMessage(playerid,COLOR_ERROR,"You Have Clan");
return 1;
}
Clan[playerid] =name;
Rank[playerid] =5;
format(string,sizeof(string),"{00FFFF}You Successfully Created Clan >> {FFFF00}%s ",name);
SendClientMessage(playerid,COLOR_DODGERBLUE,string);
return 1;
}
but in players information it save just One letter of clan name
can somebody fix it for me?
thank you really
Re: help about clan -
dominik523 - 01.11.2014
Code:
new name[24]; // set your length
if(sscanf(params, "s[24]",name))
Re: help about clan -
mehdimmz - 01.11.2014
tnx +rep
but i got one eror
D:\New folder (54)\ForYou\gamemodes\SFCRRPG.pwn(13635) : error 006: must be assigned to an array
line 13635 : Clan[playerid] =name;
Re: help about clan -
Sawalha - 01.11.2014
instead of
do ,
pawn Code:
new Clan[24][MAX_PLAYERS];
if didn't work, use:
pawn Code:
new Clan[MAX_PLAYERS][24];
which is the correct i guess.
Re: help about clan -
mehdimmz - 01.11.2014
oh
i got many erors
D:\New folder (54)\ForYou\gamemodes\SFCRRPG.pwn(451
: error 035: argument type mismatch (argument 3)
D:\New folder (54)\ForYou\gamemodes\SFCRRPG.pwn(13625) : error 033: array must be indexed (variable "Clan")
D:\New folder (54)\ForYou\gamemodes\SFCRRPG.pwn(13644) : error 033: array must be indexed (variable "Clan")
D:\New folder (54)\ForYou\gamemodes\SFCRRPG.pwn(13651) : error 033: array must be indexed (variable "Clan")
D:\New folder (54)\ForYou\gamemodes\SFCRRPG.pwn(13669) : error 033: array must be indexed (variable "Clan")
D:\New folder (54)\ForYou\gamemodes\SFCRRPG.pwn(13674) : error 033: array must be indexed (variable "Clan")
D:\New folder (54)\ForYou\gamemodes\SFCRRPG.pwn(13685) : error 033: array must be indexed (variable "Clan")
D:\New folder (54)\ForYou\gamemodes\SFCRRPG.pwn(13719) : error 033: array must be indexed (variable "Clan")
D:\New folder (54)\ForYou\gamemodes\SFCRRPG.pwn(13724) : error 033: array must be indexed (variable "Clan")
D:\New folder (54)\ForYou\gamemodes\SFCRRPG.pwn(13734) : error 033: array must be indexed (variable "Clan")
D:\New folder (54)\ForYou\gamemodes\SFCRRPG.pwn(13792) : error 033: array must be indexed (variable "Clan")
D:\New folder (54)\ForYou\gamemodes\SFCRRPG.pwn(13797) : error 033: array must be indexed (variable "Clan")
D:\New folder (54)\ForYou\gamemodes\SFCRRPG.pwn(13802) : error 033: array must be indexed (variable "Clan")
D:\New folder (54)\ForYou\gamemodes\SFCRRPG.pwn(13823) : error 033: array must be indexed (variable "Clan")
Re: help about clan -
Sawalha - 01.11.2014
can you show one line of these?
Re: help about clan -
mehdimmz - 01.11.2014
Line 4518
PHP Code:
dUserSetINT(PlayerName(playerid)).("Clan",Clan[playerid]);
Line 13625
PHP Code:
if(Clan[playerid] != 0)
Line 13644
PHP Code:
if(Clan[playerid] == 0)
an more ... Clan[playerid]
Re: help about clan -
BroZeus - 01.11.2014
You are confused between int and string varaibles...
In the command you are using 'Clan' as a string but in comparing you are using it as a int and also in writing data to user file u are using it as int...which is not possible
So i am gonna show u how to compare strings in 2 dimension array..
pawn Code:
new Clan[MAX_PLAYERS][24];//Variable declaration
#define isnull(%1) ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1])))) // paste this at top we will use this to see if string is empty or not...
Clan[0][1]= "Some Clan";//WRONG
Clan[0] = "Some Clan";//RIGHT
if(Clan[1] == 0)//WRONG
if(isnull(Clan[1]))//RIGHT
//now we are gonna see how to make a string null( to use during when player leaves clan)
Clan[0] = 0;//WRONG
Clan[0] = '\0';//RIGHT
// \0 stands for null
You need to change the saving clan name line to string according to saving system you use..
Re: help about clan -
mehdimmz - 01.11.2014
i couldn't fix it
some body can make current clan for me?
pls
Re: help about clan -
mehdimmz - 01.11.2014
upppppp
pls help