Dcmd question.
#1

Hey, I'm trying to make like a command for example: /v [name] in dcmd.

Actually what I'm making is a /creategun [gunname] command, however I can't seem to get it working.

pawn Code:
dcmd_creategun(playerid, params[])
{
    new id[64];
    if(sscanf(params,"s",id))
    {
        SendClientMessage(playerid,COLOR_YELLOW,"Usage: /creategun [GunName]");
        SendClientMessage(playerid,COLOR_YELLOW,"Deagle[3], Shotgun[1]");
        SendClientMessage(playerid,COLOR_YELLOW,"MP5[4], Sniper[7]");
    }
    else
    {
        if(sscanf(params,"deagle",id))
        {
            if(PlayerAccount[playerid][WeaponPackages] >= 3)
            {
                GivePlayerWeapon(playerid,24,100);
                PlayerAccount[playerid][WeaponPackages] -= 3;
            }
            else
            {
                SendClientMessage(playerid,COLOR_YELLOW,"Not Enough Weapon Packages");
            }
        }
}
I guess I'm doing something wrong at this:
pawn Code:
if(sscanf(params,"deagle",id))
Reply


Messages In This Thread
Dcmd question. - by oliverrud - 06.07.2010, 11:44
Re: Dcmd question. - by Betamaster - 06.07.2010, 11:57
Re: Dcmd question. - by oliverrud - 06.07.2010, 12:03
Re: Dcmd question. - by Betamaster - 06.07.2010, 12:07
Re: Dcmd question. - by oliverrud - 06.07.2010, 12:13

Forum Jump:


Users browsing this thread: 1 Guest(s)