[HELP]OnVehicleStreamin not working properly -
Lilcuete - 09.10.2010
Ok when someone enters a vehicle that has alarm and that he doesn't own it is supposed to show a marker above the vehicle but it is not working.heres the code
Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
if(CarAlarm[vehicleid][caalarm] >= 4) {
if(VehAsk[forplayerid] == 2) {
SetVehicleParamsForPlayer(vehicleid, forplayerid,1, 0);
}
}
return 1;
}
Re: [HELP]OnVehicleStreamin not working properly -
Lilcuete - 09.10.2010
Sorry for a really early bump but i really need this please help me thanks.
Re: [HELP]OnVehicleStreamin not working properly -
WillyP - 09.10.2010
so what your saying is the marker doesnt appear?
Re: [HELP]OnVehicleStreamin not working properly -
Lilcuete - 10.10.2010
Yes how can i make it appear?
Re: [HELP]OnVehicleStreamin not working properly -
WillyP - 10.10.2010
onvehiclespawn or onplayerupdate
pawn Код:
for(new i; i<MAX_PLAYERS; i++)
{
SetVehicleParamsForPlayer(VEHICLEIDHERE, i, 1, 0);
}
Re: [HELP]OnVehicleStreamin not working properly -
Rac3r - 10.10.2010
The markers don't work, or are bugged with the way vehicles are streamed in 0.3 (or so I was informed)
Just use 3DText maybe.
Re: [HELP]OnVehicleStreamin not working properly -
WillyP - 10.10.2010
Quote:
Originally Posted by Rac3r
The markers don't work, or are bugged with the way vehicles are streamed in 0.3 (or so I was informed)
Just use 3DText maybe.
|
I added it in my code, works perfectly
Re: [HELP]OnVehicleStreamin not working properly -
Lilcuete - 10.10.2010
Quote:
Originally Posted by [FU]Victious
onvehiclespawn or onplayerupdate
pawn Код:
for(new i; i<MAX_PLAYERS; i++) { SetVehicleParamsForPlayer(VEHICLEIDHERE, i, 1, 0); }
|
Ok i did this and it didnt work
heres the code this is in OnPlayerStateChange
Код:
if(CarAlarm[vehi][caalarm] >= 4 && VehAsk[playerid] == 2) {
for(new i; i<MAX_PLAYERS; i++)
{
SetVehicleParamsForPlayer(vehi, i, 1, 0);
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new st[256];
//new Float:VPosX,Float:VPosY,Float:VPosZ;
//GetVehiclePos(key1[playerid],VPosX,VPosY,VPosZ);
format(string, sizeof(string), "*[Vehicle alarm]:BEEP! BEEP! BEEP! BEEP!");
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
format(string,sizeof(string),"SMS:Vehicle %s alarm is activated,Sender: MOLE (555)",VehicleNames[GetVehicleModel(vehi)-400]);
SendClientMessage(playerid, 0xE7D5ADFF, string);
SetVehicleParamsForPlayerEx(vehi,playerid,1,1);
//iVehicleObjective[vehi][0] = 1; //Marker
//iVehicleObjective[vehi][1] = 0; //Door Lock
//CarLabel5 = Create3DTextLabel("Vehicle Alarm is on!" ,COLOR_YELLOW,VPosX,VPosY,VPosY+3,15.0,0);
//Attach3DTextLabelToVehicle(CarLabel5,key1[playerid],0.0, 0.0, 0.0);
format(st, sizeof(st), "HQ: Crime:Vehicle Alarm has been activated, Suspect Robbing: %s",name);
SendFamilyMessage(1, COLOR_DBLUE, st);
SetPVarInt(playerid, "VehON", 0);
AlarmTime[playerid] = SetTimerEx("Alarm", FLASH_TIME, 1, "i", playerid);
Stop[playerid] = SetTimerEx("Chill",SHUTDOWN,false,"i",playerid);
return 1;
}
}
Re: [HELP]OnVehicleStreamin not working properly -
Lilcuete - 10.10.2010
Anyone please help me fix this asap i really need thanks and sorry for early bump
Re: [HELP]OnVehicleStreamin not working properly -
playbox12 - 10.10.2010
Quote:
Originally Posted by Lilcuete
Anyone please help me fix this asap i really need thanks and sorry for early bump
|
pawn Код:
/Top
new myMarkedCar;
public OnGameModeInit() //Or another callback
{
myMarkedCar = CreateVehicle(400, 0.0, 0.0, 5.0, 0.0, 0,0, -1); //For example: Black Landstalker near Blueberry Acres
return 1;
}
//Whatever your want
public OnVehicleStreamIn(vehicleid, forplayerid)
{
if(vehicleid == myMarkedCar)
{
SetVehicleParamsForPlayer(TmyMarkedCar, forplayerid, 1, 0); // marker can be visible only if the vehicle streamed for player
}
return 1;
}
Thats straight fromt he wiki
https://sampwiki.blast.hk/wiki/SetVehicleParamsForPlayer
Needs some tweaking, but it should help you
Re: [HELP]OnVehicleStreamin not working properly -
Lilcuete - 10.10.2010
Quote:
Originally Posted by playbox12
pawn Код:
/Top new myMarkedCar; public OnGameModeInit() //Or another callback { myMarkedCar = CreateVehicle(400, 0.0, 0.0, 5.0, 0.0, 0,0, -1); //For example: Black Landstalker near Blueberry Acres return 1; } //Whatever your want public OnVehicleStreamIn(vehicleid, forplayerid) { if(vehicleid == myMarkedCar) { SetVehicleParamsForPlayer(TmyMarkedCar, forplayerid, 1, 0); // marker can be visible only if the vehicle streamed for player } return 1; }
Thats straight fromt he wiki
https://sampwiki.blast.hk/wiki/SetVehicleParamsForPlayer
Needs some tweaking, but it should help you
|
How can i make it for only owned vehicles all of them and if it has alarm?
like dis?
pawn Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
VehAsk[playerid] == 2//sees if he doesnt own the car
CarAlarm[vehi][caalarm]//sees if the vehicle has alarm
if(CarAlarm[vehi][caalarm] >= 4 && VehAsk[playerid] == 2) {
if(GetPlayerVehicleID(forplayer))
{
SetVehicleParamsForPlayer(vehicleid, forplayerid, 1, 0); // marker can be visible only if the vehicle streamed for player
}
Re: [HELP]OnVehicleStreamin not working properly -
playbox12 - 11.10.2010
pawn Code:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
VehAsk[playerid] == 2//sees if he doesnt own the car
CarAlarm[vehicleid][caalarm]//sees if the vehicle has alarm
if(CarAlarm[vehicleid][caalarm] >= 4 && VehAsk[playerid] == 2) {
if(GetPlayerVehicleID(forplayer))
{
SetVehicleParamsForPlayer(vehicleid, forplayerid, 1, 0); // marker can be visible only if the vehicle streamed for player
}
Not sure, I am half awake
Re: [HELP]OnVehicleStreamin not working properly -
Lilcuete - 11.10.2010
Quote:
Originally Posted by playbox12
pawn Code:
public OnVehicleStreamIn(vehicleid, forplayerid) { VehAsk[playerid] == 2//sees if he doesnt own the car CarAlarm[vehicleid][caalarm]//sees if the vehicle has alarm if(CarAlarm[vehicleid][caalarm] >= 4 && VehAsk[playerid] == 2) {
if(GetPlayerVehicleID(forplayer)) { SetVehicleParamsForPlayer(vehicleid, forplayerid, 1, 0); // marker can be visible only if the vehicle streamed for player }
Not sure, I am half awake
|
Nah it didnt work heres my code
pawn Code:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
if(CarAlarm[vehicleid][caalarm] >= 4 && VehAsk[forplayerid] == 2) {
if(GetPlayerVehicleID(forplayerid))
{
SetVehicleParamsForPlayer(vehicleid, forplayerid, 1, 0); // marker can be visible only if the vehicle streamed for player
}
}
}
Re: [HELP]OnVehicleStreamin not working properly -
playbox12 - 11.10.2010
pawn Code:
if(GetPlayerVehicleID(forplayerid))
what are you trying to do with that?
just do
pawn Code:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
if(CarAlarm[vehicleid][caalarm] >= 4 && VehAsk[forplayerid] == 2)
{
SetVehicleParamsForPlayer(vehicleid, forplayerid, 1, 0);
}
}
return 1;
}
Re: [HELP]OnVehicleStreamin not working properly -
Lilcuete - 11.10.2010
Ok that works but if your far away from your vehicle that has the marker in it it disspears and won't show again till you enter the vehicle how can i make it show still if ur far away from the vehicle and not make the marker dissapear?
heres the code
pawn Code:
new vehi = GetPlayerVehicleID(playerid);
for(new i = 0; i < GetMaxPlayers(); i++ )
{
SetVehicleParamsForPlayer(vehi, i, 1, 0);
SetVehicleParamsForPlayer(vehi, playerid, 1, 0);
}
pawn Code:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
if(CarAlarm[vehicleid][caalarm] >= 4 && VehAsk[forplayerid] == 2)
{
SetVehicleParamsForPlayer(vehicleid, forplayerid, 1, 0);
}
return 1;
}
Re: [HELP]OnVehicleStreamin not working properly -
playbox12 - 11.10.2010
Well, I believe vehicles are not synched unless someone is in it (thats what some people told me) so I don't think thats possible, although it's strange that it doesen't comeback as it should load when OnVehicleStreamIn is called, are you sure that it won't show again if you drive far off and come back?
Re: [HELP]OnVehicleStreamin not working properly -
Lilcuete - 11.10.2010
Nvm i fixed it thanks please close this topic,thanks for helping all.
Re: [HELP]OnVehicleStreamin not working properly -
playbox12 - 11.10.2010
Cool, can you tell us what fixed it?
Re: [HELP]OnVehicleStreamin not working properly -
Lilcuete - 11.10.2010
OnVehicleStreamin did.