PDA

View Full Version : Help me pls.


Sn4ke2
19/05/2015, 06:22 PM
[B][Hello guys, pls help me to do this on OnPlayerRaceCheckpoints
/B]
http://s9.postimg.org/4b9z4cf6z/cdp.jpg (http://postimg.org/image/4b9z4cf6z/)

Sn4ke2
22/05/2015, 09:30 AM
Up ? Help me

Bingo
22/05/2015, 09:32 AM
Do what?

Elaborate.

Sn4ke2
22/05/2015, 09:34 AM
No, i want to make numbers on checkpoints, like DMV Checkpoints 1/21 .

Konstantinos
22/05/2015, 09:36 AM
- You need to create a textdraw (****** it for a textdraw editor so you can make the design).
- You need to be aware of how many checkpoints this minigame has (stored in a variable).
- You need a variable (array with size of MAX_PLAYERS) and increase it in OnPlayerEnterRaceCheckpoint callback if the player is in that minigame and then format and update the text in the textdraw.
- When the player's variable is equal to max checkpoints for that minigame, end it.

Sn4ke2
22/05/2015, 09:37 AM
Oh my God :))
An example can you give it to me ? pls. +1 RP !!!

Konstantinos
22/05/2015, 09:57 AM
I'd personally something like this (an example as I don't know anything about your minigame). Also use player-textdraws:

new Player_DMV@CP[MAX_PLAYERS];

// OnPlayerConnect and when the player completes the minigame:
Player_DMV@CP[playerid] = 0;
// Also create the player-textdraws on connect

// when the minigame starts (in case the player is IN the checkpoint):
if (IsPlayerInRaceCheckpoint(playerid)) OnPlayerEnterRaceCheckpoint(playerid);

// OnPlayerEnterRaceCheckpoint:

// have a variable of whether it has started or not if it has countdown and:
if (MINIGAME_HAS_NOT_STARTED_VARIABLE) return 1; // at the top so it won't go to the next checkpoint
// if it doesn't have a countdown, skip it

switch (MAX_CHECKPOINTS_VARIABLE - Player_DMV@CP[playerid])
{
case 1:
{
// player got last checkpoint.. end it for the player
DisablePlayerRaceCheckpoint(playerid);
}
case 2:
{
++Player_DMV@CP[playerid];
SetPlayerRaceCheckpoint(playerid, 1, X_CP_HERE, Y_CP_HERE, Z_CP_HERE, 0.0, 0.0, 0.0, 9.0);
}
default:
{
++Player_DMV@CP[playerid];
SetPlayerRaceCheckpoint(playerid, 0, X_CP_HERE, Y_CP_HERE, Z_CP_HERE, X_CP_NEXT_HERE, Y_CP_NEXT_HERE, Z_CP_NEXT_HERE, 9.0);
}
}

new text[30];
format(text, sizeof (text), "DMV CHECKPOINTS: %i/%i", Player_DMV@CP[playerid], MAX_CHECKPOINTS_VARIABLE);
PlayerTextDrawSetString(playerid, PLAYER_TEXTDRAW_HERE, text);

Sn4ke2
22/05/2015, 10:40 AM
Error's

D:\Saints-Network Original -\gamemodes\saints.pwn(6554) : error 017: undefined symbol "MAX_CHECKPOINTS_VARIABLE"
D:\Saints-Network Original -\gamemodes\saints.pwn(6564) : error 017: undefined symbol "X_CP_HERE"
D:\Saints-Network Original -\gamemodes\saints.pwn(6569) : error 017: undefined symbol "X_CP_HERE"
D:\Saints-Network Original -\gamemodes\saints.pwn(6574) : error 017: undefined symbol "MAX_CHECKPOINTS_VARIABLE"
D:\Saints-Network Original -\gamemodes\saints.pwn(6575) : error 017: undefined symbol "TextDMV"
D:\Saints-Network Original -\gamemodes\saints.pwn(11645) : warning 217: loose indentation
D:\Saints-Network Original -\gamemodes\saints.pwn(11645) : error 017: undefined symbol "Textdraw0"
D:\Saints-Network Original -\gamemodes\saints.pwn(11646) : error 017: undefined symbol "Textdraw0"
D:\Saints-Network Original -\gamemodes\saints.pwn(11647) : error 017: undefined symbol "Textdraw0"
D:\Saints-Network Original -\gamemodes\saints.pwn(11648) : error 017: undefined symbol "Textdraw0"
D:\Saints-Network Original -\gamemodes\saints.pwn(11649) : error 017: undefined symbol "Textdraw0"
D:\Saints-Network Original -\gamemodes\saints.pwn(11650) : error 017: undefined symbol "Textdraw0"
D:\Saints-Network Original -\gamemodes\saints.pwn(11651) : error 017: undefined symbol "Textdraw0"
D:\Saints-Network Original -\gamemodes\saints.pwn(11652) : error 017: undefined symbol "Textdraw0"
D:\Saints-Network Original -\gamemodes\saints.pwn(11654) : warning 217: loose indentation
D:\Saints-Network Original -\gamemodes\saints.pwn(11644) : warning 204: symbol is assigned a value that is never used: "TextDMV"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase

Konstantinos
22/05/2015, 10:44 AM
an example as I don't know anything about your minigame

That means I'm not aware of your variables names etc.
You're supposed you have to create those variables yourself and modify the code with the correct names and values.

Sn4ke2
22/05/2015, 10:58 AM
Can you make a filterscript fir me please ?

Ghazal
22/05/2015, 11:22 AM
This section is not for creating you things, but helping you creating them your own. though, you can find alot of race systems released on the forums.

Fast search:
http://forum.sa-mp.com/showthread.php?t=143764
http://forum.sa-mp.com/showthread.php?t=316636
http://forum.sa-mp.com/showthread.php?t=3860
http://forum.sa-mp.com/showthread.php?t=262063

Sn4ke2
22/05/2015, 01:01 PM
i will try and i will tell you if it's work. Thank you !