SA-MP Forums Archive
Race checkpoints didn't work help! - 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: Race checkpoints didn't work help! (/showthread.php?tid=476290)



Race checkpoints didn't work help! - [RDX]Dark_Angle - 17.11.2013

Please help me dear respected scripters. i have made a checkpoint text draw but in race he mixed up all players checkpints i wan't that every one only see his own checkpoints please is if any respected scripter post a perfect code



Re: Race checkpoints didn't work help! - ]Rafaellos[ - 17.11.2013

Maybe post you'r code so we could improve it!


Re: Race checkpoints didn't work help! - [RDX]Dark_Angle - 18.11.2013

i deleted my old code thats why i request for help here if you can write new code...


AW: Re: Race checkpoints didn't work help! - BigETI - 18.11.2013

Quote:
Originally Posted by [RDX]Dark_Angle
Посмотреть сообщение
i deleted my old code thats why i request for help here if you can write new code...
https://sampforum.blast.hk/showthread.php?tid=447813


Re: Race checkpoints didn't work help! - [RDX]Dark_Angle - 18.11.2013

This is the error
The players checkpoints are not increasing on entering checkpoints

Quote:

new PlayerTotalCps[MAX_PLAYERS] = 0;
new PlayerTotalCheckpoints;

//================================================== ============================
public OnPlayerEnterRaceCheckpoint(playerid){
new string[128];
PlayerTotalCheckpoints(playerid, PlayerTotalCps, sizeof(PlayerTotalCps));
if(PlayerTotalCps[playerid] == 1) {
format(string, sizeof(string), "Check points ~w~%d~r~/~w~9", PlayerTotalCps);
TextDrawSetString(cpstats, PlayerTotalCps);
}
if(PlayerTotalCps[playerid] == 2) {
format(string, sizeof(string), "Check points ~w~%d~r~/~w~9", PlayerTotalCps);
TextDrawSetString(cpstats, PlayerTotalCps);
return 1;
}
if(PlayerTotalCps[playerid] == 3) {
format(string, sizeof(string), "Check points ~w~%d~r~/~w~9", PlayerTotalCps);
TextDrawSetString(cpstats, PlayerTotalCps);
return 1;
}
if(PlayerTotalCps[playerid] == 4) {
format(string, sizeof(string), "Check points ~w~%d~r~/~w~9", PlayerTotalCps);
TextDrawSetString(cpstats, PlayerTotalCps);
return 1;
}
if(PlayerTotalCps[playerid] == 5) {
format(string, sizeof(string), "Check points ~w~%d~r~/~w~9", PlayerTotalCps);
GameTextForAll(string, 6000,3);
TextDrawSetString(cpstats, PlayerTotalCps);
return 1;
}
if(PlayerTotalCps[playerid] == 6) {
format(string, sizeof(string), "Check points ~w~%d~r~/~w~9", PlayerTotalCps);
TextDrawSetString(cpstats, PlayerTotalCps);
return 1;
}
if(PlayerTotalCps[playerid] == 7) {
format(string, sizeof(string), "Check points ~w~%d~r~/~w~9", PlayerTotalCps);
TextDrawSetString(cpstats, PlayerTotalCps);
return 1;
}
if(PlayerTotalCps[playerid] == {
format(string, sizeof(string), "Check points ~w~%d~r~/~w~9", PlayerTotalCps);
TextDrawSetString(cpstats, PlayerTotalCps);
return 1;
}
if(PlayerTotalCps[playerid] == 9) {
format(string, sizeof(string), "Check points ~w~%d~r~/~w~9", PlayerTotalCps);
TextDrawSetString(cpstats, PlayerTotalCps);
return 1;
}
if(PlayerTotalCps[playerid] == 10) {
format(string, sizeof(string), "Race Finshed", PlayerTotalCps);
TextDrawSetString(cpstats, PlayerTotalCps);
return 1;
}
return 1;
}

Quote:

C:\Users\MalikObstinate\Desktop\SanAndreas MissiOns DoNe\gamemodes\1VortexRace.pwn(730) : error 012: invalid function call, not a valid address
C:\Users\MalikObstinate\Desktop\SanAndreas MissiOns DoNe\gamemodes\1VortexRace.pwn(730) : warning 215: expression has no effect
C:\Users\MalikObstinate\Desktop\SanAndreas MissiOns DoNe\gamemodes\1VortexRace.pwn(730) : warning 215: expression has no effect
C:\Users\MalikObstinate\Desktop\SanAndreas MissiOns DoNe\gamemodes\1VortexRace.pwn(730) : warning 215: expression has no effect
C:\Users\MalikObstinate\Desktop\SanAndreas MissiOns DoNe\gamemodes\1VortexRace.pwn(730) : error 001: expected token: ";", but found ")"
C:\Users\MalikObstinate\Desktop\SanAndreas MissiOns DoNe\gamemodes\1VortexRace.pwn(730) : error 029: invalid expression, assumed zero
C:\Users\MalikObstinate\Desktop\SanAndreas MissiOns DoNe\gamemodes\1VortexRace.pwn(730) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.




Re: Race checkpoints didn't work help! - ]Rafaellos[ - 18.11.2013

Something like this?

pawn Код:
public OnPlayerEnterRaceCheckpoint(playerid)
{
    new string[128];
    PlayerTotalCps[playerid]++;
    if(PlayerTotalCps[playerid] < 10)
    {
        format(string, sizeof(string), "Check points ~w~%d~r~/~w~9", PlayerTotalCps);
        TextDrawSetString(cpstats, PlayerTotalCps);
    }
    else
    {
        TextDrawSetString(cpstats, "Race Finished");
    }
    return 1;
}



Re: Race checkpoints didn't work help! - [RDX]Dark_Angle - 18.11.2013

yes how i do it one by one


Re: Race checkpoints didn't work help! - ]Rafaellos[ - 18.11.2013

You don't need to do it one by one. Don't forget to destroy the current Checkpoint and create the next one.


Re: Race checkpoints didn't work help! - [RDX]Dark_Angle - 19.11.2013

OK Thanks Dear


Re: Race checkpoints didn't work help! - [RDX]Dark_Angle - 19.11.2013

pawn Код:
public OnPlayerEnterRaceCheckpoint(playerid){
    new string[128];
    PlayerTotalCps[playerid]++;
    switch(Stats[playerid]){
            case 1:{
            DisablePlayerRaceCheckpoint(playerid);
            PlayerPlaySound(playerid, 1058, 0.0, 0.0, 10.0);
            SetPlayerRaceCheckpoint(playerid, 0,2144.6772, -1851.0477, 3.269,1945.6807, -1842.3702, 3.2681,10);
            Stats[playerid] = 2;
pawn Код:
C:\Users\MalikObstinate\Desktop\SanAndreas MissiOns DoNe\gamemodes\1VortexRace - Copy.pwn(716) : error 028: invalid subscript (not an array or too many subscripts): "PlayerTotalCps"
C:\Users\MalikObstinate\Desktop\SanAndreas MissiOns DoNe\gamemodes\1VortexRace - Copy.pwn(716) : warning 215: expression has no effect
C:\Users\MalikObstinate\Desktop\SanAndreas MissiOns DoNe\gamemodes\1VortexRace - Copy.pwn(716) : error 001: expected token: ";", but found "]"
C:\Users\MalikObstinate\Desktop\SanAndreas MissiOns DoNe\gamemodes\1VortexRace - Copy.pwn(716) : error 029: invalid expression, assumed zero
C:\Users\MalikObstinate\Desktop\SanAndreas MissiOns DoNe\gamemodes\1VortexRace - Copy.pwn(716) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.