SA-MP Forums Archive
personal cars - 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: personal cars (/showthread.php?tid=97372)



personal cars - [HKS]dlegend - 13.09.2009

how would i make my own personal car and make them for other users

thanks


Re: personal cars - Energyzer - 13.09.2009

Use this code:
pawn Код:
if(newcar == HERE THE CARID!)
    {
      new PlayerName[MAX_PLAYER_NAME];
      GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
      if(strcmp(PlayerName, "Player_Name", true) == 0)
      {
          SendClientMessage(playerid, 0xFFFF00AA,"Welcome to your Car Player_Name");
      }
      else
      {
          format(string, sizeof(string), "** Alarm bip bip bip **");
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
          SendClientMessage(playerid, 0xFFFF00AA, "This car is for Player_Name only ! ! !");
          RemovePlayerFromVehicle(playerid);
          }
        }



Re: personal cars - coole210 - 13.09.2009

....


Re: personal cars - [HKS]dlegend - 13.09.2009

thanks alot


Re: personal cars - [HKS]dlegend - 28.09.2009

if(newcar == HERE THE CARID!)
{
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
if(strcmp(PlayerName, "Player_Name", true) == 0)
{
SendClientMessage(playerid, 0xFFFF00AA,"Welcome to your Car Player_Name");
}
else
{
format(string, sizeof(string), "** Alarm bip bip bip **");
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
SendClientMessage(playerid, 0xFFFF00AA, "This car is for Player_Name only ! ! !");
RemovePlayerFromVehicle(playerid);
}
}
werewould i put this code onplayerstatechange


Re: personal cars - [XST]O_x - 28.09.2009

Quote:
Originally Posted by dlegend
if(newcar == HERE THE CARID!)
{
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
if(strcmp(PlayerName, "Player_Name", true) == 0)
{
SendClientMessage(playerid, 0xFFFF00AA,"Welcome to your Car Player_Name");
}
else
{
format(string, sizeof(string), "** Alarm bip bip bip **");
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
SendClientMessage(playerid, 0xFFFF00AA, "This car is for Player_Name only ! ! !");
RemovePlayerFromVehicle(playerid);
}
}
werewould i put this code onplayerstatechange
OnPlayerEnterVehicle?


Re: personal cars - Lewwy - 28.09.2009

OnPlayerStateChange would be a bit better, as OnPlayerEnterVehicle is called when a player goes into the enter vehicle animation, while OnPlayerStateChange can detect when the player is actually driving the vehicle.


Re: personal cars - [HKS]dlegend - 28.09.2009

ah but would i just repeat the function for a diff player name


Re: personal cars - Lewwy - 28.09.2009

pawn Код:
if(strcmp(PlayerName, "Player_Name1", true) == 0)
{
    SendClientMessage(playerid, 0xFFFF00AA, "Welcome to your vehicle, Player_Name.");
}
if(strcmp(PlayerName, "Player_Name2", true) == 0)
{
    SendClientMessage(playerid, 0xFFFF00AA, "Welcome to your vehicle, Player_Name2.");
}
else
{
    // not the owner code here.
}



Re: personal cars - XCultz - 28.09.2009

he means like only a certain gang or person can enter the car