SA-MP Forums Archive
[Tutorial] [Vehicule Private] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Română/Romanian (https://sampforum.blast.hk/forumdisplay.php?fid=40)
+----- Forum: Salonul Scripturilor (https://sampforum.blast.hk/forumdisplay.php?fid=77)
+----- Thread: [Tutorial] [Vehicule Private] (/showthread.php?tid=467483)



[Vehicule Private] - DiegoRider - 03.10.2013


- Salut . Va voi arata cum sa faceti un vehicul privat .
- Este foarte simplu !
- Il voi face in 2 versiuni , vehicul privat dupa nume sau dupa skin .


pawn Код:
//Versiunea 1 (V1) - Dupa Nume

new version1veh;


version1veh = CreateVehicle(ModelId, xPos, yPos, zPos, AnglePos, Color1, Color2, TimeRespawn);//Pune in : public OnGameModeInit


public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
       new pname[MAX_PLAYER_NAME];
       GetPlayerName(playerid, pname, sizeof(pname));
       new veh1 = GetPlayerVehicleID(playerid);
       if(veh1 == version1veh)
       {
         if(!strcmp(pname, "NickName", true))//"NickName" inlocuieste cu numele tau , sau a proprietarului
         {
           SendClientMessage(playerid, -1, "Este vehiculul tau !");
         }
         else
         {
           SendClientMessage(playerid, -1, "Nu e vehiculul tau !");
           RemovePlayerFromVehicle(playerid);
         }
       }
       return 1;
    }
    return 1;
}
pawn Код:
//Versiunea 2 (V2) - Dupa Skin

new version2veh;


version2veh = CreateVehicle(ModelId, xPos, yPos, zPos, AnglePos, Color1, Color2, TimeRespawn);//Pune in : public OnGameModeInit


public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
   {
       new veh2 = GetPlayerVehicleID(playerid);
       if(veh2 == version2veh)
       {
         new sskin = GetPlayerSkin(playerid);
         if(sskin == 0) // 0 - skin id (CJ)
         {
           SendClientMessage(playerid, -1, "Este vehiculul tau !");
         }
         else
         {
           SendClientMessage(playerid, -1, "Nu e vehiculul tau !");
           RemovePlayerFromVehicle(playerid);
           return 1;
         }
       }
   }
   return 1;
}

- Sper ca l-am facut cat mai pe inteles !
- Astept pareri , sper sa va placa !
- Daca te-am ajutat +Rep . Multumesc !



Re: [Vehicule Private] - DanishHaq - 03.10.2013

Usor si bine explicat. Felicitari pentru tutorial .


Re: [Vehicule Private] - DiegoRider - 03.10.2013

Multumesc :3


Re: [Vehicule Private] - ShikamaruSama - 03.10.2013

Un tutorial foarte simplu , poate ajuta foarte multi incepatori , felicitari.


Re: [Vehicule Private] - DiegoRider - 03.10.2013

Multumesc :3


Re: [Vehicule Private] - DiegoRider - 16.11.2013

Sper ca va fost de ajutor !


Re: [Vehicule Private] - FlashGun - 18.11.2013

Deci sa inteleg ca aici trebuie adaugata masina, pozitia, culorile si astea?: (Ex: inlocuiesc ModelId cu 456 sa zicem)
version1veh = CreateVehicle(ModelId, xPos, yPos, zPos, AnglePos, Color1, Color2, TimeRespawn);


Re: [Vehicule Private] - DiGiTaL_AnGeL - 19.11.2013

Asta nu poate fi numit tutorial, nu ai explicat nimic. trebuie sa justifici fiecare cod altfel nu invata nimeni DE CE, ci doar CUM.


Re: [Vehicule Private] - DiegoRider - 07.11.2014

Cui ii convine bine , filterscriptul e bun..