[SSCANF] Help please.
#2

Try this:

pawn Код:
CMD:giveweapon(playerid, params[])
{
    new weap,targetid, string[128];
    if(sscanf(params,"ui", targetid, weap)) return SendClientMessage(playerid, NO_PARAMS, "USAGE: /giveweapon [ID or Name] [Weapon]");
    if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, ERROR, "Error: Player is not connected or is yourself");
    if(weap < 1 || weap > 46) return SendClientMessage, ERROR, "Error: You have entered an invalid weapon ID.");
    GivePlayerWeapon(targetid, weap, 99999);
    format(string, sizeof(string), "You have given a weapon to %s", Name(targetid));
    SendClientMessage(playerid, SUCCESS, string);
    format(string, sizeof(string), "You have received a weapon from %s", Name(playerid));
    SendClientMessage(targetid, SUCCESS, string);
    return 1;
}
Reply


Messages In This Thread
[SSCANF] Help please. - by Magic_Time - 07.02.2013, 00:00
Re: [SSCANF] Help please. - by AphexCCFC - 07.02.2013, 00:08
Re: [SSCANF] Help please. - by Magic_Time - 07.02.2013, 00:12
Re: [SSCANF] Help please. - by Scrillex - 07.02.2013, 00:20

Forum Jump:


Users browsing this thread: 1 Guest(s)