SA-MP Forums Archive
HELP! Argument Type Mismatch(argument 2) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: HELP! Argument Type Mismatch(argument 2) (/showthread.php?tid=326301)



HELP! Argument Type Mismatch(argument 2) - Sal - 17.03.2012

On this line i get Arguemt Type Mismatch,
SetVehicleNumberPlate(Veh, plateset);

This is the Command!
pawn Код:
if(strcmp(cmd, "/plate", true) == 0)
    {
        new plateset;
        plateset = strval(tmp);
        Veh = GetPlayerVehicleID(playerid);
        if(!IsPlayerInAnyVehicle(playerid))
        {
            SendClientMessage(playerid, 0xFF0000AA, "You are not in a vehicle!");
            return 1;
        }
        else
        {
            SetVehicleNumberPlate(Veh, plateset);
            format(string, sizeof(string), "You have set your vehicle's plate to %s", plateset);
            SendClientMessage(playerid, 0xFF000AA, string);
            return 1;
        }
        return 1;
And FYI Veh is defined, just further up in the script.


Re: HELP! Argument Type Mismatch(argument 2) - AustinJ - 17.03.2012

This isn't tested and may contain errors.
pawn Код:
if(strcmp(cmd, "/plate", true) == 0)
    {
        new plateset[32]; // 32 Is Max For A Plate
        format(plateset, 32, "%s", tmp);
        Veh = GetPlayerVehicleID(playerid);
        if(!IsPlayerInAnyVehicle(playerid))
        {
            SendClientMessage(playerid, 0xFF0000AA, "You are not in a vehicle!");
            // return 1; Remove this is point less
        }
        else
        {
            SetVehicleNumberPlate(Veh, plateset);
            SetVehicleToRespawn(Veh); // Vehicle must be respawned in order for new license to take effect.
            PutPlayerInVehicle(playerid, Veh, 0); // Put the player back in the vehicle after respawn. May need delay.
            format(string, sizeof(string), "You have set your vehicle's plate to %s", plateset);
            SendClientMessage(playerid, 0xFF000AA, string);
            // return 1; Remove this is point less
        }
        return 1;



Re: HELP! Argument Type Mismatch(argument 2) - Sal - 17.03.2012

Thank you Austin, The code compiled.