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; }
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. |
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; }
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. https://sampforum.blast.hk/showthread.php?tid=564533 |
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 } }
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; }
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. |