SetVehiclePlantenumber
#1

Hello everyone, So I've been getting a problem while compiling a code

Код:
CMD:changeplate(playerid, params[])
{
	if(Player_Data[playerid][Donator] == 0)
	{
		return SCM(playerid, RED, "You need to have atleast Donator level 1 for this command.");
	}
	else
 	{
  		if(GetPlayerState(playerid != PLAYER_STATE_DRIVER))
  		{
  			return SCM(playerid, RED, "You need to be in a vehicle to change it's numberplate.");
		}
		else
    	        {
    	                new Cplate,
	 		        VehID = GetPlayerVehicleID(playerid);

       		        if(sscanf(params, "s[8]", Cplate)) return SCM(playerid, GREY, "[SERVER]: Usage: /changeplate [NUMBER/WORD COMBINATION] - Maximum 8 numbers/letters");
			if(1 > Cplate > 8)
			{
				SCM(playerid, GREY, "[SERVER]: ERROR: Your numberplate must be be between 1 and 8 characters");
			}
			else
			{
          		        SetVehicleNumberPlate(VehID, Cplate);
          		        return 1;
			}
                }
	}
	return 1;
}
And the error is:
error 035: argument type mismatch (argument 2)
Reply
#2

new Cplate[10], should solve it
Reply
#3

pawn Код:
if(GetPlayerState(playerid != PLAYER_STATE_DRIVER))
should be:

pawn Код:
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
Reply
#4

Quote:
Originally Posted by ikey07
Посмотреть сообщение
new Cplate[10], should solve it
When I do this I get error 033: array must be indexed (variable "Cplate")
Reply
#5

pawn Код:
CMD:changeplate(playerid, params[])
{
    if(Player_Data[playerid][Donator] == 0)
    {
        return SCM(playerid, RED, "You need to have atleast Donator level 1 for this command.");
    }
    else
    {
        if(GetPlayerState(playerid != PLAYER_STATE_DRIVER))
        {
            return SCM(playerid, RED, "You need to be in a vehicle to change it's numberplate.");
        }
        else
                {
                        new Cplate[8],
                    VehID = GetPlayerVehicleID(playerid);

                    if(sscanf(params, "s[8]", Cplate)) return SCM(playerid, GREY, "[SERVER]: Usage: /changeplate [NUMBER/WORD COMBINATION] - Maximum 8 numbers/letters");
            if(8 < strlen(Cplate) < 1)
            {
                SCM(playerid, GREY, "[SERVER]: ERROR: Your numberplate must be be between 1 and 8 characters");
            }
            else
            {
                        SetVehicleNumberPlate(VehID, Cplate);
                        return 1;
            }
                }
    }
    return 1;
}
Reply
#6

pawn Код:
#define DIALOG_PLATE = 999

CMD:changeplate(playerid)
{
    if(Player_Data[playerid][Donator] > 0)
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER))
        {
            ShowPlayerDialog(playerid, DIALOG_PLATE, DIALOG_STYLE_INPUT, ":: Vehicle Change plate for Donators ::", "{ffffff}Please insert your selected plate for\n[ff0000}Vehicle", "Change", "Exit"");
        }
        else return SCM(playerid, RED, "
You need to be in a vehicle to change it's numberplate.");
    }
    else return SCM(playerid, RED, "You need to have atleast Donator level 1 for this command.");
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_PLATE) //Dialog Register
    {
        if(response)
        {
            new vid = GetPlayerVehicleID(playerid);
            new plate[24] = inputtext;
            if(strlen(plate) <= 8 || strlen(plate) >= 1)
            {
                SetVehicleNumberPlate(vid, plate);
                SCM(playerid, RED, "Your vehicle plate has been changed.");
            }
            else return SCM(playerid, RED, "Vehicle plate boundries abused. Please try an nother input.");
        }
        if(!response)return SCM(playerid, RED, "Canceled.");
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)