Need help
#1

This is what i have:

pawn Код:
else if(strcmp(x_nr,"plates",true) == 0)
        {
          if(PlayerInfo[playerid][pPcarkey] == 999 && PlayerInfo[playerid][pPcarkey2] == 999 && PlayerInfo[playerid][pPcarkey3] == 999)
            {
            SendClientMessage(playerid, COLOR_GREY,"  You don't have a vehicle to buy new plates for.");
            return 1;
            }
            if(GetPlayerMoney(playerid) < 4999)
            {
            SendClientMessage(playerid, COLOR_GREY,"  You don't have enough money to buy new plates.");
            return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /v plates [Numberplate]");
                    return 1;
                }
                new plate;
                plate = strval(tmp);


                new vehid;
                if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { vehid = PlayerInfo[playerid][pPcarkey]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { vehid = PlayerInfo[playerid][pPcarkey2]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { vehid = PlayerInfo[playerid][pPcarkey3]; }
                else { return 1; }

            if(IsPlayerInVehicle(playerid, vehid))
            {
                SetVehicleNumberPlate(vehid, plate);
                CarInfo[vehid][cLicense] = plate;
            SafeGivePlayerMoney(playerid, -5000);
            GameTextForPlayer(playerid, "~w~Bill for New Plates~n~~r~-$5000", 5000, 1);
            OnPropUpdate();
                    OnPlayerUpdate(playerid);
                    return 1;
            }
            else
            {
            SendClientMessage(playerid, COLOR_GREY,"  You are not in your vehicle.");
            return 1;
            }
        }
        else
        {
          SendClientMessage(playerid, COLOR_WHITE, "HINT: (/v)ehicle [name]");
          SendClientMessage(playerid, COLOR_WHITE, "Available names: park, lock(1-3), sell, sellto, color");
          return 1;
        }
      }
      return 1;
    }
I get this error:
error 035: argument type mismatch (argument 2)

on this line:
SetVehicleNumberPlate(vehid, plate);

Can anyone help me?
Reply
#2

its supposed to be an array

use plate[]
Reply
#3

I don't know how to use an array, can someone help me?
Reply
#4

Its a string:

Код:
new ThisIsAString[15];
Then just use:

Код:
SetVehicleNumberPlate(vehid, ThisIsAString);
change:
Код:
new plate;
in to:
Код:
new plate[15];
Reply
#5

So where do I put

new ThisIsAString[15];
Reply
#6

https://sampwiki.blast.hk/wiki/Scripting_Basics#Arrays
Reply
#7

I still don't understand arrays. =/
Reply
#8

If you wont learn not many people with bother helping you
Reply
#9

Just because i don't understand them doesn't mean im not willing to learn
Reply
#10

Anyone? I really need this
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)