Jump to content

JohnGTPS

Membru
  • Posts

    15
  • Joined

  • Last visited

Posts posted by JohnGTPS

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

  2. 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}
    };

     

  3. 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;
    
    }

     

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

  5. 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;
    
    }
  6. 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. 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

    Quote
    this 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;
    }

     

     

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.