SA-MP Forums Archive
Need help - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need help (/showthread.php?tid=67785)



Need help - riding-bmx - 04.03.2009

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?


Re: Need help - hoodline - 04.03.2009

its supposed to be an array

use plate[]


Re: Need help - riding-bmx - 05.03.2009

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


Re: Need help - JaYmE - 05.03.2009

Its a string:

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

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



Re: Need help - riding-bmx - 05.03.2009

So where do I put

new ThisIsAString[15];


Re: Need help - hoodline - 05.03.2009

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


Re: Need help - riding-bmx - 05.03.2009

I still don't understand arrays. =/


Re: Need help - hoodline - 05.03.2009

If you wont learn not many people with bother helping you


Re: Need help - riding-bmx - 05.03.2009

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


Re: Need help - riding-bmx - 05.03.2009

Anyone? I really need this