JohnGTPS
-
Posts
15 -
Joined
-
Last visited
Content Type
Profiles
Forums
News
Documentation
Posts posted by JohnGTPS
-
-
-
4 minutes ago, Sancky said:
no, because you initialised 3 indexes, you can also just let the dimension empty [] and the compiler will put the right size for it.
ill try to replace [6] to [3] but i get a out of bounce then ill try to empty the 2nd dimension, it didnt compile, and the compiler didnt show any symbol that not used to and the .amx file is 0kb, is there any way to fix this problem?
-
3 minutes ago, Sancky said:
Float:raceCheckpoints[MAX_RACE_CHECKPOINTS][6]
you need to look here, this is an 2D (2 dimensions) array, first dimension is [MAX_RACE_CHECKPOINTS] and second dimension is [6], you need to replace [6] with [3] because you use only 3 indexes of that dimension in your array.
if i replace the [6] with [3] possible i get a out of bounce array.
-
1 minute ago, Sancky said:
you can replace the size with 3 at the 2nd dimension if you don't need 6.
how? i don't get it
-
hello guys! someone can help me im getting an error: error 052: multi-dimensional arrays must be fully initialized, i dont know why.
MAX_RACE_CHECKPOINTS 6 new const Float:raceCheckpoints[MAX_RACE_CHECKPOINTS][6] = { {1366.896484, 430.360900, 19.168024}, {1323.226562, 330.576416, 18.968442}, {1343.616943, 299.939147, 18.961088}, {1398.594238, 272.719421, 18.965473}, {1382.345458, 217.131347, 18.931575} };
-
40 minutes ago, Sancky said:
no offense, but your script is a completely mess and doesn't have any logic.
can you give me an example code for this topic? and ill try to fix my script.
-
hello guys! if the player1 is at the finish line how to remove it to the player2 from the race and disable his racecheckpoint
// commands CMD:race(playerid, params[]) { new targetid, player2; if(sscanf(params, "u", targetid)) { return SCM(playerid, COLOR_SYNTAX, "Usage: /race [playerid]"); } if(PlayerInfo[playerid][pRace]) { return SCM(playerid, COLOR_SYNTAX, "You are currently in the race, type /quitrace to quit the currently race event."); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(targetid == playerid) { return SCM(playerid, COLOR_SYNTAX, "You can't use this command on yourself."); } PlayerInfo[playerid][pRace] = 1; PlayerInfo[targetid][pRace] = 1; IsPlayerInRace[playerid] = 1; IsPlayerInRace[targetid] = 1; PlayerInfo[targetid][pPlayer2] = player2; //Player1 = IsPlayerInRace[playerid]; //SetPlayerRaceCheckpoint( playerid, 0, raceCheckpoints[ 0 ][ 0 ], raceCheckpoints[ 0 ][ 1 ], raceCheckpoints[ 0 ][ 2 ], raceCheckpoints[ 1 ][ 3 ], raceCheckpoints[ 1 ][ 4 ], raceCheckpoints[ 1 ][ 5 ], 7.0 ); ShowPlayerDialog(playerid, DIALOG_RACE, DIALOG_STYLE_LIST, "Select Vehicle", "Infernus\nTurismo\nNRG-500\nSuperGT\nBullet", "Select", "Cancel"); return 1; } // example maded dialog if(listitem == 0) // INFERNUS { Vehicle1 = CreateVehicle(411, 403.526580, 2493.906005, 16.225225, 89.63, 0, 1, 0, 1); PutPlayerInVehicle(playerid, Vehicle1, 0); Vehicle2 = CreateVehicle(411, 403.405151, 2508.656250, 16.230072, 88.96, 0, 1, 0, 1); PutPlayerInVehicle(player2, Vehicle2, 0); startRace(playerid); startRace(player2); } startRace(playerid) { if(IsPlayerInRace[playerid]) { IsPlayerInRace[playerid] = 1; playerCheckpoint[playerid] = 0; SetPlayerRaceCheckpoint(playerid, 0, raceCheckpoints[0][0], raceCheckpoints[0][1], raceCheckpoints[0][2], raceCheckpoints[1][3], raceCheckpoints[1][4], raceCheckpoints[1][5], 7.0 ); SendClientMessage(playerid, -1, "Checkpoint set!, Goodluck!"); } return 1; } startRace1(playerid) { new player2 = PlayerInfo[playerid][pPlayer2]; if(IsPlayerInRace[pPlayer2]) { IsPlayerInRace[player2] = 1; playerCheckpoint[player2] = 0; SetPlayerRaceCheckpoint(player2, 0, raceCheckpoints[0][0], raceCheckpoints[0][1], raceCheckpoints[0][2], raceCheckpoints[1][3], raceCheckpoints[1][4], raceCheckpoints[1][5], 7.0 ); SendClientMessage(player2, -1, "Checkpoint set!, Goodluck!"); } return 1; }
-
1 minute ago, Sancky said:
startRace(playerid) { IsPlayerInRace[playerid] = 1; playerCheckpoint[playerid] = 0; SetPlayerRaceCheckpoint(playerid, 0, raceCheckpoints[ 0 ][ 0 ], raceCheckpoints[ 0 ][ 1 ], raceCheckpoints[ 0 ][ 2 ], raceCheckpoints[ 1 ][ 3 ], raceCheckpoints[ 1 ][ 4 ], raceCheckpoints[ 1 ][ 5 ], 7.0 ); SendClientMessage(playerid, -1, "POTANGINAAAAAA"); return 1; }
one last thing, if i type /race then the dialog_race is shown up there are no checkpoints seted
-
2 minutes ago, Sancky said:
you should set at StartRace the variable playerCheckpoint[playerid] at value 0
can you fix it? thankyou somuch
-
can you check this my code? when you're at the first checkpoint, the next checkpoint doesn't show, then the first checkpoint hasn't disappeared yet? CMD:race(playerid, params[]) { new targetid; if(sscanf(params, "u", targetid)) { return SCM(playerid, COLOR_SYNTAX, "Usage: /race [playerid]"); } if(PlayerInfo[playerid][pRace]) { return SCM(playerid, COLOR_SYNTAX, "You are currently in the race, type /quitrace to quit the currently race event."); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(targetid == playerid) { return SCM(playerid, COLOR_SYNTAX, "You can't use this command on yourself."); } PlayerInfo[playerid][pRace] = 1; //Player1 = IsPlayerInRace[playerid]; //SetPlayerRaceCheckpoint( playerid, 0, raceCheckpoints[ 0 ][ 0 ], raceCheckpoints[ 0 ][ 1 ], raceCheckpoints[ 0 ][ 2 ], raceCheckpoints[ 1 ][ 3 ], raceCheckpoints[ 1 ][ 4 ], raceCheckpoints[ 1 ][ 5 ], 7.0 ); ShowPlayerDialog(playerid, DIALOG_RACE, DIALOG_STYLE_LIST, "Select Vehicle", "Infernus\nTurismo\nNRG-500\nSuperGT\nBullet", "Select", "Cancel"); return 1; } // for dialog case DIALOG_RACE: { if(response) { if(listitem == 0) // INFERNUS { startRace(playerid); } } } // and this is my function startRace(playerid) { if(IsPlayerInRace[playerid]) { SetPlayerRaceCheckpoint(playerid, 0, raceCheckpoints[ 0 ][ 0 ], raceCheckpoints[ 0 ][ 1 ], raceCheckpoints[ 0 ][ 2 ], raceCheckpoints[ 1 ][ 3 ], raceCheckpoints[ 1 ][ 4 ], raceCheckpoints[ 1 ][ 5 ], 7.0 ); SendClientMessage(playerid, -1, "POTANGINAAAAAA" ); } return 1; }
-
can you check this my code? when you're at the first checkpoint, the next checkpoint doesn't show, then the first checkpoint hasn't disappeared yet
CMD:race(playerid, params[]) { new targetid; if(sscanf(params, "u", targetid)) { return SCM(playerid, COLOR_SYNTAX, "Usage: /race [playerid]"); } if(PlayerInfo[playerid][pRace]) { return SCM(playerid, COLOR_SYNTAX, "You are currently in the race, type /quitrace to quit the currently race event."); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(targetid == playerid) { return SCM(playerid, COLOR_SYNTAX, "You can't use this command on yourself."); } PlayerInfo[playerid][pRace] = 1; //Player1 = IsPlayerInRace[playerid]; //SetPlayerRaceCheckpoint( playerid, 0, raceCheckpoints[ 0 ][ 0 ], raceCheckpoints[ 0 ][ 1 ], raceCheckpoints[ 0 ][ 2 ], raceCheckpoints[ 1 ][ 3 ], raceCheckpoints[ 1 ][ 4 ], raceCheckpoints[ 1 ][ 5 ], 7.0 ); ShowPlayerDialog(playerid, DIALOG_RACE, DIALOG_STYLE_LIST, "Select Vehicle", "Infernus\nTurismo\nNRG-500\nSuperGT\nBullet", "Select", "Cancel"); return 1; } // for dialog case DIALOG_RACE: { if(response) { if(listitem == 0) // INFERNUS { startRace(playerid); } } } // and this is my function startRace(playerid) { if(IsPlayerInRace[playerid]) { SetPlayerRaceCheckpoint(playerid, 0, raceCheckpoints[ 0 ][ 0 ], raceCheckpoints[ 0 ][ 1 ], raceCheckpoints[ 0 ][ 2 ], raceCheckpoints[ 1 ][ 3 ], raceCheckpoints[ 1 ][ 4 ], raceCheckpoints[ 1 ][ 5 ], 7.0 ); SendClientMessage(playerid, -1, "POTANGINAAAAAA" ); } return 1; }
-
7 minutes ago, Sancky said:
you have OnPlayerEnterRaceCheckpoint callback, check somehow in that callback if its in the last race checkpoint, use DisablePlayerRaceCheckpoint and give the reward to player
Quotethis is my OnPlayerEnterRaceCheckpoint where i put the DisablePlayerRaceCheckpoint? public OnPlayerEnterRaceCheckpoint( playerid ) { if(IsPlayerInRace[playerid]) { playerCheckpoint[playerid] ++; new checkPoint = playerCheckpoint[playerid], nextPoint = playerCheckpoint[playerid] + 1; if( checkPoint < MAX_RACE_CHECKPOINTS - 1) SetPlayerRaceCheckpoint(playerid, 0, raceCheckpoints[checkPoint][0], raceCheckpoints[checkPoint][1], raceCheckpoints[checkPoint][2], raceCheckpoints[nextPoint][3], raceCheckpoints[nextPoint][4], raceCheckpoints[nextPoint][5], 7.0 ); else SetPlayerRaceCheckpoint(playerid, 1, raceCheckpoints[checkPoint ][0], raceCheckpoints[checkPoint][1], raceCheckpoints[checkPoint][2], 0.0, 0.0, 0.0, 7.0 ); SendClientMessage( playerid, -1, "Keep going!." ); } return 1; }
-
-
IF THE PLAYER IS IN THE LAST RACE CHECKPOINT OR THE FINISH LINE, HOW TO BE DISABLED IT AND GIVE A REWARD?
error 052: multi-dimensional arrays must be fully initialized
in Discuţii scripting
Posted
if i make it to raceCheckpoints[0][0] to raceCheckpoints[0][3] it will be working properly?