03.10.2013, 15:12
(
Последний раз редактировалось DiegoRider; 08.11.2013 в 13:42.
)
- 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 !