![]() |
#1 |
Big Clucker
![]() ![]() Join Date: Sep 2016
Location: My Mothers House
Posts: 79
Reputation: 2
|
![]()
I need help everytime player drives on the left side of the road there should be a gametext that'll show the player that he's driving in the left side and I want the player to get 1 star every 5 seconds on driving in the left side
i've tried it but i failed. (I'm new in scripting sorry) Code:
forward OnPlayerGhostDriving(playerid, zone, Float:X, Float:Y, Float:Z, Float:A); public OnPlayerGhostDriving(playerid, zone, Float:X, Float:Y, Float:Z, Float:A) { //Example: GameTextForPlayer(playerid, "~r~Drive in the right side of the road !", 1000, 4); // Start a 5 second timer to end the Timer SetTimerEx("EndTimer", 5000, false, "i", playerid); return 1; } forward OnPlayerDrivingOnTrainTrack(playerid, zone, Float:X, Float:Y, Float:Z); public OnPlayerDrivingOnTrainTrack(playerid, zone, Float:X, Float:Y, Float:Z) { //example: GameTextForPlayer(playerid, "~r~Do not drive on~n~the train tracks!", 1000, 4); SetTimerEx("EndTimer1", 5000, false, "i", playerid); return 1; } // The timer function - the code to be executed when the timer is called goes here forward EndTimer(playerid); public EndTimer(playerid) { if ( GetPlayerWantedLevel(playerid) > 0 ) // If player has 1 or more stars { GameTextForPlayer(playerid, "~r~Do not drive on~n~the train tracks!", 1000, 4); SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 1); } } forward EndTimer1(playerid); // The timer function - the code to be executed when the timer is called goes here public EndTimer1(playerid) { // Let's notify them also GameTextForPlayer(playerid, "~r~Do not drive on~n~the train tracks!", 1000, 4); SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 1); return 1; } |
![]() |
![]() |
![]() |
#2 |
Banned
![]() Join Date: Jun 2008
Location: Azerbaijan
Posts: 6,431
Reputation: 525
|
![]()
This is something that only full high end scripters would attempt really, I'd suggest you start off with something a lot simpler.
What'd you get up to as such? and what were you using? I notice no usage of the streamer functions, nor natives in checking their real locations. |
![]() |
![]() |
![]() |
#3 | |
Big Clucker
![]() ![]() Join Date: Sep 2016
Location: My Mothers House
Posts: 79
Reputation: 2
|
![]() Quote:
and he gave this code Code:
forward OnPlayerGhostDriving(playerid, zone, Float:X, Float:Y, Float:Z, Float:A); public OnPlayerGhostDriving(playerid, zone, Float:X, Float:Y, Float:Z, Float:A) { //Example: GameTextForPlayer(playerid, "~r~Wrong lane!", 1000, 4); return 1; } forward OnPlayerDrivingOnTrainTrack(playerid, zone, Float:X, Float:Y, Float:Z); public OnPlayerDrivingOnTrainTrack(playerid, zone, Float:X, Float:Y, Float:Z) { //example: GameTextForPlayer(playerid, "~r~Do not drive on~n~the train tracks!", 1000, 4); return 1; } |
|
![]() |
![]() |
![]() |
#4 |
Big Clucker
![]() ![]() Join Date: Sep 2016
Location: My Mothers House
Posts: 79
Reputation: 2
|
![]()
anyone? Sry.
|
![]() |
![]() |
![]() |
#5 |
Gangsta
![]() ![]() ![]() ![]() Join Date: Aug 2016
Posts: 567
Reputation: 73
|
![]()
I agree with Sew.
What you are looking for is called nodes. Since there isn't a released code from the thread below (also Gamer_Z removed all his threads and left). This would be extremely hard for someone who doesn't know how, to begin with. On the bright side, NaS has the lastest nodes possible, could get them from him and play around with it a bit. http://forum.sa-mp.com/showthread.php?t=564533 |
![]() |
![]() |
![]() |
#6 | |
Big Clucker
![]() ![]() Join Date: Sep 2016
Location: My Mothers House
Posts: 79
Reputation: 2
|
![]() Quote:
![]() |
|
![]() |
![]() |
![]() |
#7 |
Banned
![]() Join Date: Jun 2008
Location: Azerbaijan
Posts: 6,431
Reputation: 525
|
![]()
I looked over this last night, there is a function to check if the player is in the zone, but it's quite complicated.
What you will need is a tick timer, and simply have it count up on a variable hooked to the player (Will be an array) and simply count up if continuing to drive on the wrong side of the road. Once it hits 5, it'll then have to add the star. You can then ignore that player by checking in that star giving check, whether they have a wanted level. Making a 5 second timer attached to the player will make them wanted, or looked at, even if they started driving properly. That include, is actually quite impressive,as well as the other releases that have covered this. |
![]() |
![]() |
![]() |
#8 |
Big Clucker
![]() ![]() Join Date: Sep 2016
Location: My Mothers House
Posts: 79
Reputation: 2
|
![]()
I've removed it cuz it's bugging my script and I have a new problem with textdraws i don't know much with textdraws
![]() here's the code The line at the top Code:
Convoys_Init() { for (new i; i < MAX_CONVOYS; i++) { AConvoys[i][ConvoyTextLeader] = TextDrawCreate(320.0, 1.0, " "); // Create the textdraw for the leader TextDrawSetShadow(AConvoys[i][ConvoyTextLeader], 1); // Reduce the shadow to 1 TextDrawAlignment(AConvoys[i][ConvoyTextLeader], 2); // Align the convoy-infobar to the center for the leader TextDrawUseBox(AConvoys[i][ConvoyTextLeader], 1); // Set the missiontext to display inside a box TextDrawBoxColor(AConvoys[i][ConvoyTextLeader] ,0x00000066); // Set the box color of the missiontext TextDrawLetterSize(AConvoys[i][ConvoyTextLeader], 0.3, 0.8); // Set Letter Size TextDrawFont(AConvoys[i][ConvoyTextLeader], 2); // Set the font AConvoys[i][ConvoyTextMember] = TextDrawCreate(320.0, 1.0, " "); // Create the textdraw for the members TextDrawSetShadow(AConvoys[i][ConvoyTextLeader], 1); // Reduce the shadow to 1 TextDrawAlignment(AConvoys[i][ConvoyTextMember], 2); // Align the convoy-infobar to the center for the members TextDrawUseBox(AConvoys[i][ConvoyTextMember], 1); // Set the missiontext to display inside a box TextDrawBoxColor(AConvoys[i][ConvoyTextMember] ,0x00000066); // Set the box color of the missiontext TextDrawLetterSize(AConvoys[i][ConvoyTextMember], 0.3, 0.8); // Set Letter Size TextDrawFont(AConvoys[i][ConvoyTextMember], 2); // Set the font } } The 2 lines below is speedometere Code:
Speedometer_Setup(playerid) { // Setup the speedometer for the player APlayerData[playerid][SpeedometerText] = TextDrawCreate(500.0, 389.0, " "); TextDrawFont(APlayerData[playerid][SpeedometerText], 2); TextDrawLetterSize(APlayerData[playerid][SpeedometerText], 0.350000, 1.500000); TextDrawColor(APlayerData[playerid][SpeedometerText], -1); TextDrawSetShadow(APlayerData[playerid][SpeedometerText], 0); TextDrawUseBox(APlayerData[playerid][SpeedometerText], 1); TextDrawBoxColor(APlayerData[playerid][SpeedometerText], 0x00000066); APlayerData[playerid][FuelGauge] = TextDrawCreate(500.0, 409.0, " "); TextDrawFont(APlayerData[playerid][FuelGauge], 2); TextDrawLetterSize(APlayerData[playerid][FuelGauge], 0.350000, 1.500000); TextDrawColor(APlayerData[playerid][FuelGauge], -1); TextDrawSetShadow(APlayerData[playerid][FuelGauge], 0); TextDrawUseBox(APlayerData[playerid][FuelGauge], 1); TextDrawBoxColor(APlayerData[playerid][FuelGauge], 0x00000066); // Enable the TextDraw for this player TextDrawShowForPlayer(playerid, APlayerData[playerid][SpeedometerText]); TextDrawShowForPlayer(playerid, APlayerData[playerid][FuelGauge]); // Start the speedometer timer APlayerData[playerid][SpeedometerTimer] = SetTimerEx("Speedometer_Update", 100, true, "i", playerid); return 1; } |
![]() |
![]() |
![]() |
#9 |
Banned
![]() Join Date: Jun 2008
Location: Azerbaijan
Posts: 6,431
Reputation: 525
|
![]()
With textdraws, it's 640x480 is the size of the screen, so you want to look for a TextDrawCreate that is made up in the top left at 0,0, and the other bottom right ones will be near 600x440 or something.
You'll just have to find them, as they're likely to be linked to something else and because that isn't working, or that it's been editted wrong, it'll stop it from being taken off the screen. |
![]() |
![]() |
![]() |
#10 | |
Big Clucker
![]() ![]() Join Date: Sep 2016
Location: My Mothers House
Posts: 79
Reputation: 2
|
![]() Quote:
|
|
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[FilterScript] Detect Driving on the wrong side of the road | cessil | Filterscripts | 21 | 28/05/2015 04:49 AM |
[HELP] The tram is driving on the wrong street side! | Pasa | Scripting Help | 2 | 02/01/2013 07:19 PM |
Making camera look from left side to player | AiVAMAN | Help Archive | 2 | 14/02/2010 08:23 AM |