27.03.2011, 06:26
I'm trying to make a gang system for my server, but this annoying test command won't work.
The command is suppose to be, "/getid <GangName>", which returns the ID of the gang name I enter:
I'm pretty sure it has something to do with the GetGangIDFromName function I created, here is the function:
Thanks
The command is suppose to be, "/getid <GangName>", which returns the ID of the gang name I enter:
pawn Код:
dcmd_getid(playerid,params[])
{
new name[40],str[128];
if(sscanf(params,"s[40]",name)) return 0;
new gangid = GetGangIDFromName(name);
format(str,sizeof(str),"The gang %s's ID is %d",GangInfo[gangid][GangName],gangid);
SendClientMessage(playerid,WHITE,str);
return 1;
}
pawn Код:
stock GetGangIDFromName(name[])
{
for(new i; i< MAX_GANGZ; i++)
{
if(strfind(GangInfo[i][GangName],name,false) != -1)
{
return i;
}
}
return -1;
}