changing from get playervehicleID to get playervehicleMODEL
#1

Hello again all im having this very annoying problem. No matter how I try do this always seem`s messed up. I want these to read like cop car models not actual vehicle ids how would I go about doing that. The setup works fine as it is but i prefer model because i cannot add additional vehicles without interference.Thanks for looking.

Код:
ReservedCar()
{	
  new RS[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37};  
  for(new rs = 0; rs < MAX_PLAYERS; rs++)
    {
    if (IsPlayerConnected(rs) && Player[rs][Kicked] == 0)
      {
      Player[rs][CarCheck] = GetPlayerVehicleID(rs);
      for (new rs2 = 0; rs2 < sizeof(RS); rs2++)
        {
        if (Player[rs][CarCheck] == RS[rs2])
          {
          return 1;
          }
        }
      }          
    }
  return 0;

Reply
#2

https://sampwiki.blast.hk/wiki/GetVehicleModel ?
Reply
#3

Thank you will try that out. More suggestions are always welcomed as well.
Reply
#4

Can`t figure out how i would get it working with the wiki entry there.
Reply
#5

So would that be efficient replace GetPlayerVehicleID with the code there Seif or would that not work?
Reply
#6

I got the cop cars working. Now the boats and sell cars need`s work. I need it to detect the model but having trouble how id get that working cause i got sections in my gamemode that look for these 2 lines Carsell() and Boat() which makes it complicated for me to figure out any solutions would be highly welcomed thanks.

Код:
Boat()
{
	new BT[] = {119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 196, 197, 198, 199, 200, 201, 202, 203};
  for(new bt = 0; bt < MAX_PLAYERS; bt++)
    {
    if (IsPlayerConnected(bt) && Player[bt][Kicked] == 0)
      {
      Player[bt][CarCheck] = GetPlayerVehicleID(bt);
      for (new bt2 = 0; bt2 < sizeof(BT); bt2++)
        {
        if (Player[bt][CarCheck] == BT[bt2])
          {
          return 1;
          }
        }
      }
    }
  return 0;
}
Carsell()
{
  new SC[] = {40, 43, 46, 49, 52, 55, 58, 61, 64, 67, 70, 73, 76, 79, 82, 84, 92, 94, 97, 100, 103, 106, 109, 112, 130, 133, 136, 137, 140, 143, 146, 149, 152, 155,
  158, 162, 165, 168, 171, 174, 177, 180, 183, 186, 189, 192, 193, 203, 204, 205, 207, 210, 213, 216, 219, 222, 225, 228, 231, 234, 237, 240, 243, 246, 249, 252, 255,
  258, 261, 263, 265, 278, 279, 280, 281, 282, 285, 288, 291, 294, 297, 300, 303, 306, 309, 312, 315, 318, 321, 324, 327, 330, 331, 336, 339, 342, 345, 348, 351, 354,
  357 , 360, 363, 366, 369, 372, 375, 378, 381, 384, 387, 390, 393, 396, 399, 402, 405, 408, 411, 414, 417, 420, 423, 426, 429, 432, 435, 438, 441, 444, 447, 450, 453,
  456, 459, 462, 465, 468, 476, 481, 489, 495, 503, 511, 517, 523, 531, 537, 542, 552, 561, 573, 579, 582};
  for(new cs = 0; cs < MAX_PLAYERS; cs++)
    {
    if (IsPlayerConnected(cs) && Player[cs][Kicked] == 0)
      {
      Player[cs][CarCheck] = GetPlayerVehicleID(cs);
      for (new cs2 = 0; cs2 < sizeof(SC); cs2++)
        {
        if (Player[cs][CarCheck] == SC[cs2])
          {
          return 1;
          }
        }
      }
    }
  return 0;
}
Reply
#7

Anybody out there able figure this out? Thanks
Reply
#8

Replace
Код:
GetPlayerVehicleID(cs);
with

Код:
GetVehicleModel(GetPlayerVehicleID(cs));
Replace
Код:
GetPlayerVehicleID(bt);
with

Код:
GetVehicleModel(GetPlayerVehicleID(bt));
Reply
#9

Thank you very much.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)