Race checkpoints didn't work help!
#1

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
Reply
#2

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

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

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
Reply
#5

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.

Reply
#6

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;
}
Reply
#7

yes how i do it one by one
Reply
#8

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

OK Thanks Dear
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)