SA-MP Forums Archive
Help me pls. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help me pls. (/showthread.php?tid=574697)



Help me pls. - Sn4ke2 - 19.05.2015

[B][Hello guys, pls help me to do this on OnPlayerRaceCheckpoints
/B]



Re: Help me pls. - Sn4ke2 - 22.05.2015

Up ? Help me


Re: Help me pls. - Bingo - 22.05.2015

Do what?

Elaborate.


Re: Help me pls. - Sn4ke2 - 22.05.2015

No, i want to make numbers on checkpoints, like DMV Checkpoints 1/21 .


Re: Help me pls. - Konstantinos - 22.05.2015

- 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.


Re: Help me pls. - Sn4ke2 - 22.05.2015

Oh my God )
An example can you give it to me ? pls. +1 RP !!!


Re: Help me pls. - Konstantinos - 22.05.2015

I'd personally something like this (an example as I don't know anything about your minigame). Also use player-textdraws:
PHP код:
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(playerid1X_CP_HEREY_CP_HEREZ_CP_HERE0.00.00.09.0);
    }
    default:
    {
        ++
Player_DMV@CP[playerid];
        
SetPlayerRaceCheckpoint(playerid0X_CP_HEREY_CP_HEREZ_CP_HEREX_CP_NEXT_HEREY_CP_NEXT_HEREZ_CP_NEXT_HERE9.0);
    }
}
new 
text[30];
format(textsizeof (text), "DMV CHECKPOINTS: %i/%i"Player_DMV@CP[playerid], MAX_CHECKPOINTS_VARIABLE);
PlayerTextDrawSetString(playeridPLAYER_TEXTDRAW_HEREtext); 



Re: Help me pls. - Sn4ke2 - 22.05.2015

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 © 1997-2006, ITB CompuPhase



Re: Help me pls. - Konstantinos - 22.05.2015

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
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.


Re: Help me pls. - Sn4ke2 - 22.05.2015

Can you make a filterscript fir me please ?