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; }
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 ? |
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; }
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;
}
pawn Код:
|
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; }
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; } |
PlayerInfo[playerid][VIP] != 1
PlayerInfo[playerid][VIP] == 0