more than one private car/personal car
#4

You could do this.

pawn Код:
new vcar_names[MAX_PLAYER_NAME][25];

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new vehicleid =GetPlayerVehicleID(playerid);
    new pname[MAX_PLAYER_NAME];

    GetPlayerName(playerid, pname, sizeof pname);
    if (newstate == PLAYER_STATE_DRIVER)
    {
         if (vehicleid == vcar[0])
         {
              if(strcmp(pname, vcar_names[0] true) == 0)

              {
                  SendClientMessage(playerid, COLOR_RED, "WELCOME VIP");
                  return 1;
              }
              else

              {
                  RemovePlayerFromVehicle(playerid);
                  SendClientMessage(playerid, COLOR_RED, "THIS VEHICLE DOES NOT BELONG TO YOU");
              }
         }
    }
    return 1;
}


// then you create them this way, setting their name/owner

vcar[0] = CreateVehicle(...);
vcar_names[0] = "Marricio";
vcar[1] = CreateVehicle(...);
vcar_names[1] = "John";
vcar[2] = CreateVehicle(...);
vcar_names[2] = "kaos999";
vcar[etc..] = CreateVehicle(...);
vcar_names[etc..] = "anyname";
Reply


Messages In This Thread
more than one private car/personal car - by kaos999 - 05.08.2013, 01:11
Re: more than one private car/personal car - by Marricio - 05.08.2013, 01:23
Re: more than one private car/personal car - by kaos999 - 05.08.2013, 01:27
Re: more than one private car/personal car - by Marricio - 05.08.2013, 01:33
Re: more than one private car/personal car - by kaos999 - 05.08.2013, 01:35
Re: more than one private car/personal car - by kaos999 - 05.08.2013, 02:03
Re: more than one private car/personal car - by Isolated - 05.08.2013, 02:05
Re: more than one private car/personal car - by kaos999 - 05.08.2013, 02:06
Re: more than one private car/personal car - by Isolated - 05.08.2013, 02:11
Re: more than one private car/personal car - by Marricio - 05.08.2013, 02:23

Forum Jump:


Users browsing this thread: 1 Guest(s)