HELP! Argument Type Mismatch(argument 2)
#1

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.
Reply
#2

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;
Reply
#3

Thank you Austin, The code compiled.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)