SA-MP Forums Archive
[AJUDA] Carros VIP - 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: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [AJUDA] Carros VIP (/showthread.php?tid=263195)



[AJUDA] Carros VIP - marcos5680 - 20.06.2011

olha ai esse comando de carro elegy para VIP

Код:
CMD:elegy(playerid, params[])
{
    if(PlayerInfo[playerid][VIP] != 1) return SendClientMessage(playerid,0xD8D8D8FF,"[BCF] - Vocк nгo й VIP !");
    new Float:X,Float:Y,Float:Z,Float:Angle, carid;
	GetPlayerPos(playerid,X,Y,Z);
	GetPlayerFacingAngle(playerid,Angle);
    carid = GetPlayerVehicleID(playerid);
	carid = CreateVehicle(562,X,Y,Z,0.0,-1,-1,9000000);
    new Text3D:vehicle3Dtext;
    vehicle3Dtext = Create3DTextLabel( "Veiculo VIP", 0xB4B5B7FF, 30.0,40.0,50.0,40.0,0);
    Attach3DTextLabelToVehicle(vehicle3Dtext, carid, 0.0,-0.0,0.5);
	PutPlayerInVehicle( playerid, carid, 0)   ;
	LinkVehicleToInterior(carid, GetPlayerInterior(playerid));
    AddVehicleComponent( carid, 1028)   ;
    AddVehicleComponent( carid, 1046)   ;
    AddVehicleComponent( carid, 1171)   ;
    AddVehicleComponent( carid, 1149)   ;
    AddVehicleComponent( carid, 1035)   ;
    AddVehicleComponent( carid, 1147)   ;
    AddVehicleComponent( carid, 1036)   ;
    AddVehicleComponent( carid, 1040)   ;
    ChangeVehiclePaintjob( carid, 2)   ;
    AddVehicleComponent( carid, 1010)   ;
    AddVehicleComponent( carid, 1097)   ;
    AddVehicleComponent( carid, 1087)   ;
	TogglePlayerControllable(playerid,true);
    return 1;
}
ENTAO COMO EU FAЗO PARA SУ PLAYERS VIP[if(PlayerInfo[playerid][VIP] != 1)] ENTRAR NO CARROS? E QUANDO UM PLAYER NORMAL ENTRA ELE Й EJETADO DO CARRO!!



Re: [AJUDA] Carros VIP - DartakousLien - 20.06.2011

https://sampwiki.blast.hk/wiki/OnPlayerStateChange

da uma olhada, e segue a logica, quando o state dele for condutor e ele entrar num elegy e nao for vip ejecta, se nao sabes as funcoes

https://sampwiki.blast.hk/wiki/GetVehicleModel - detecta modelo, neste caso poe " == 562" que й o modelo do elegy
https://sampwiki.blast.hk/wiki/RemovePlayerFromVehicle - ejecta

entendeu ?


Respuesta: Re: [AJUDA] Carros VIP - marcos5680 - 20.06.2011

Quote:
Originally Posted by DJloko
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/OnPlayerStateChange

da uma olhada, e segue a logica, quando o state dele for condutor e ele entrar num elegy e nao for vip ejecta, se nao sabes as funcoes

https://sampwiki.blast.hk/wiki/GetVehicleModel - detecta modelo, neste caso poe " == 562" que й o modelo do elegy
https://sampwiki.blast.hk/wiki/RemovePlayerFromVehicle - ejecta

entendeu ?
nao

mais tipo eu devo colokar assim?

Код:
CMD:elegy(playerid, params[])
{
    if(PlayerInfo[playerid][VIP] != 1) return SendClientMessage(playerid,0xD8D8D8FF,"[BCF] - Vocк nгo й VIP !");
	{
	new Float:X,Float:Y,Float:Z,Float:Angle, carid;
	GetPlayerPos(playerid,X,Y,Z);
	GetPlayerFacingAngle(playerid,Angle);
    carid = GetPlayerVehicleID(playerid);
	carid = CreateVehicle(562,X,Y,Z,0.0,-1,-1,9000000);
    new Text3D:vehicle3Dtext;
    vehicle3Dtext = Create3DTextLabel( "Veiculo VIP", 0xB4B5B7FF, 30.0,40.0,50.0,40.0,0);
    Attach3DTextLabelToVehicle(vehicle3Dtext, carid, 0.0,-0.0,0.5);
	PutPlayerInVehicle( playerid, carid, 0)   ;
	LinkVehicleToInterior(carid, GetPlayerInterior(playerid));
    AddVehicleComponent( carid, 1028)   ;
    AddVehicleComponent( carid, 1046)   ;
    AddVehicleComponent( carid, 1171)   ;
    AddVehicleComponent( carid, 1149)   ;
    AddVehicleComponent( carid, 1035)   ;
    AddVehicleComponent( carid, 1147)   ;
    AddVehicleComponent( carid, 1036)   ;
    AddVehicleComponent( carid, 1040)   ;
    ChangeVehiclePaintjob( carid, 2)   ;
    AddVehicleComponent( carid, 1010)   ;
    AddVehicleComponent( carid, 1097)   ;
    AddVehicleComponent( carid, 1087)   ;
	TogglePlayerControllable(playerid,true);
    }
    else
    {
    SendClientMessage(playerid, 0xAA3333AA, "[BCF] -  Voce nao pode pegar um carro VIP novamente");
	}
	return 1;
}



Re: [AJUDA] Carros VIP - DartakousLien - 20.06.2011

pawn Код:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)//se o state й driver, condutor
    {
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 562)//se o modelo й 562, elegy
        {
            if(PlayerInfo[playerid][VIP] != 1)//se nao й vip
            {
                RemovePlayerFromVehicle(playerid);//ejecta do carro
            }
        }
    }
    return 1;
}
entendeu agora?


Respuesta: Re: [AJUDA] Carros VIP - marcos5680 - 20.06.2011

Quote:
Originally Posted by DJloko
Посмотреть сообщение
pawn Код:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)//se o state й driver, condutor
    {
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 562)//se o modelo й 562, elegy
        {
            if(PlayerInfo[playerid][VIP] != 1)//se nao й vip
            {
                RemovePlayerFromVehicle(playerid);//ejecta do carro
            }
        }
    }
    return 1;
}
entendeu agora?
Entendi mais nao deu certo porque o player consegue entrar no carro VIP!


Re: [AJUDA] Carros VIP - [SamP]Knife - 21.06.2011

Bom como foi eu que fiz este comando , eu devo ajudar quem tem dificuldades com ele.

Код:
CMD:elegy(playerid, params[])
{
    if(PlayerInfo[playerid][VIP] != 1) return SendClientMessage(playerid,0xD8D8D8FF,"[BCF] - Vocк nгo й VIP !"),RemovePlayerFromVehicle(playerid,GetPlayerVehicleID(playerid));
    new Float:X,Float:Y,Float:Z,Float:Angle, carid;
	GetPlayerPos(playerid,X,Y,Z);
	GetPlayerFacingAngle(playerid,Angle);
    carid = GetPlayerVehicleID(playerid);
	carid = CreateVehicle(562,X,Y,Z,0.0,-1,-1,9000000);
    new Text3D:vehicle3Dtext;
    vehicle3Dtext = Create3DTextLabel( "Veiculo VIP", 0xB4B5B7FF, 30.0,40.0,50.0,40.0,0);
    Attach3DTextLabelToVehicle(vehicle3Dtext, carid, 0.0,-0.0,0.5);
	PutPlayerInVehicle( playerid, carid, 0)   ;
	LinkVehicleToInterior(carid, GetPlayerInterior(playerid));
    AddVehicleComponent( carid, 1028)   ;
    AddVehicleComponent( carid, 1046)   ;
    AddVehicleComponent( carid, 1171)   ;
    AddVehicleComponent( carid, 1149)   ;
    AddVehicleComponent( carid, 1035)   ;
    AddVehicleComponent( carid, 1147)   ;
    AddVehicleComponent( carid, 1036)   ;
    AddVehicleComponent( carid, 1040)   ;
    ChangeVehiclePaintjob( carid, 2)   ;
    AddVehicleComponent( carid, 1010)   ;
    AddVehicleComponent( carid, 1097)   ;
    AddVehicleComponent( carid, 1087)   ;
	TogglePlayerControllable(playerid,true);
    return 1;
}



Respuesta: Re: [AJUDA] Carros VIP - marcos5680 - 21.06.2011

Quote:
Originally Posted by [SamP]Knife
Посмотреть сообщение
Bom como foi eu que fiz este comando , eu devo ajudar quem tem dificuldades com ele.

Код:
CMD:elegy(playerid, params[])
{
    if(PlayerInfo[playerid][VIP] != 1) return SendClientMessage(playerid,0xD8D8D8FF,"[BCF] - Vocк nгo й VIP !"),RemovePlayerFromVehicle(playerid,GetPlayerVehicleID(playerid));
    new Float:X,Float:Y,Float:Z,Float:Angle, carid;
	GetPlayerPos(playerid,X,Y,Z);
	GetPlayerFacingAngle(playerid,Angle);
    carid = GetPlayerVehicleID(playerid);
	carid = CreateVehicle(562,X,Y,Z,0.0,-1,-1,9000000);
    new Text3D:vehicle3Dtext;
    vehicle3Dtext = Create3DTextLabel( "Veiculo VIP", 0xB4B5B7FF, 30.0,40.0,50.0,40.0,0);
    Attach3DTextLabelToVehicle(vehicle3Dtext, carid, 0.0,-0.0,0.5);
	PutPlayerInVehicle( playerid, carid, 0)   ;
	LinkVehicleToInterior(carid, GetPlayerInterior(playerid));
    AddVehicleComponent( carid, 1028)   ;
    AddVehicleComponent( carid, 1046)   ;
    AddVehicleComponent( carid, 1171)   ;
    AddVehicleComponent( carid, 1149)   ;
    AddVehicleComponent( carid, 1035)   ;
    AddVehicleComponent( carid, 1147)   ;
    AddVehicleComponent( carid, 1036)   ;
    AddVehicleComponent( carid, 1040)   ;
    ChangeVehiclePaintjob( carid, 2)   ;
    AddVehicleComponent( carid, 1010)   ;
    AddVehicleComponent( carid, 1097)   ;
    AddVehicleComponent( carid, 1087)   ;
	TogglePlayerControllable(playerid,true);
    return 1;
}
Cara esse ai fiko assim ! quando um player normal digita esse comando em um carro normal aparece a mensagem voce nao й vip e remove o carro que ele esta :S eu queria que quando o player VIP faz o carro e sai pra faze algo e alguem tentar roubar ele seria removido do carro !! ajuda ae


Re: [AJUDA] Carros VIP - DartakousLien - 21.06.2011

se voce tem mais que um nivel de vip, entao й normal que aconteзe, acho eu
subestitui
pawn Код:
PlayerInfo[playerid][VIP] != 1
por
pawn Код:
PlayerInfo[playerid][VIP] == 0



Re: [AJUDA] Carros VIP - mengueh - 21.06.2011

Exato :

!= 1 // Diferente de 1, no caso se for Vip nнvel 0/2/3/4/5 ele vai executar os comandos
>= 1 // Maior igual a 1
<= 1 // Menor igual a 1

Substitui por >=1 ao invez de != 1