06.07.2010, 11:44
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.
I guess I'm doing something wrong at this:
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");
}
}
}
pawn Code:
if(sscanf(params,"deagle",id))