Why does this return Unknown command?
#1

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:

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;
}
I'm pretty sure it has something to do with the GetGangIDFromName function I created, here is the function:

pawn Код:
stock GetGangIDFromName(name[])
{
    for(new i; i< MAX_GANGZ; i++)
    {
        if(strfind(GangInfo[i][GangName],name,false) != -1)
        {
            return i;
        }
    }
    return -1;
}
Thanks
Reply


Messages In This Thread
Why does this return Unknown command? - by mrcoolballs - 27.03.2011, 06:26
Re: Why does this return Unknown command? - by Grim_ - 27.03.2011, 06:35
Re: Why does this return Unknown command? - by mrcoolballs - 27.03.2011, 06:50

Forum Jump:


Users browsing this thread: 1 Guest(s)