Error: error 035: argument type mismatch (argument 1)
#1

hi all, ive got this error with a command im using. error 035: argument type mismatch (argument 1)

pawn Код:
CMD:giveaweapon(playerid, params[])
{
    if(APlayerData[playerid][PlayerLevel] == 2) return SendClientMessage(playerid,0xff0000ff,"You aren't an admin");
    new target, weap[32], ammo;
    if(sscanf(params, "us[32]i", target, weap, ammo)) return SendClientMessage(playerid, -1, "[*] Usage: /giveweapon [playerid/name] [weaponid/name] [ammo]");
    else if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "[*] Enter a valid player ID/name!");

    new WeapNames[48][32] = {
        {"Unarmed (Fist)"},     {"Brass Knuckles"},     {"Golf Club"},      {"Night Stick"},
        {"Knife"},      {"Baseball Bat"},       {"Shovel"},     {"Pool Cue"},
        {"Katana"},     {"Chainsaw"},       {"Purple Dildo"},       {"Big White Vibrator"},
        {"Medium White Vibrator"},      {"Small White Vibrator"},       {"Flowers"},        {"Cane"},
        {"Grenade"},        {"Teargas"},        {"Molotov"},        {" "},      {" "},      {" "},
        {"Colt 45"},        {"Colt 45(Silenced)"},      {"Deagle"},     {"Normal Shotgun"},     {"Sawnoff Shotgun"},
        {"Combat Shotgun"},     {"Micro Uzi(Mac 10)"},      {"SMG(MP5)"},       {"AK47"},       {"M4"},
        {"Tec9"},       {"Country Rifle"},      {"Sniper Rifle"},       {"Rocket Launcher"},
        {"Heat-Seeking Rocket Launcher"},       {"Flamethrower"},       {"Minigun"},        {"Satchel Charge"},
        {"Detonator"},      {"Spray Can"},      {"Fire Extinguisher"},      {"Camera"},     {"Night Vision Goggles"},
        {"Infrared Vision Goggles"},        {"Parachute"},      {"Fake Pistol"}
    }, weapon = -1;
    for(new w; w < 48; w++) if(strfind(WeapNames[w], weap, true) != -1) { weapon = w; break; }
    if(weapon == -1) weapon = strval(weap);
    if(weapon < 0 || weapon > 47) return SendClientMessage(playerid, -1, "[*] Enter a valid weapon ID!");
    GivePlayerWeapon(target, weapon, ammo);
    new pName[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
    GetPlayerName(target, weap, MAX_PLAYER_NAME);
    format(string, sizeof string, "[*] Admin %s has given %s a %s with %i ammo.", pName, weap, WeapNames[weapon], ammo);
    SendClientMessageToAll(string);<<THIS IS LINE WITH ERROR
    format(string, sizeof string, "[*] Admin %s has given you a %s with %i ammo!", pName, WeapNames[weapon], ammo);
    SendClientMessage(playerid, -1, string);
   
    return 1;
}
Reply
#2

pawn Код:
SendClientMessageToAll(-1, string);
You need to include a color when using this function, as a hex value or what not.
https://sampwiki.blast.hk/wiki/SendClientMessageToAll
https://sampwiki.blast.hk/wiki/Colors
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)