[HELP] I have a problem with adding.
#1

Hello, i'm creating a derby minigame, and i ran into a problem. When a player gets into a checkpoint i want to record that he ran into a checkpoint, so i add 1 to mcp. The problem is that server, doesn't add anything to MCP, and i get a warning. here's the script:

OnPlayerEnterCheckpoint

Код:
else if(mgyra[playerid] == 1)
    {
        new randomss;
        new string1[15];
    	randomss = random(sizeof(Mgame1CP));
    	mcp[playerid]+1; // warning on this line
    	format(string1, sizeof(string1), "[%d/50] CP.", mcp[playerid]); // this always shows up as zero :/
   		GameTextForPlayer(playerid,string1, 3000, 4);
		for(new i; i < MAX_PLAYERS; i++)
		{
	    	if(mgyra[i] == 1)
	    	{
	    	    DisablePlayerRaceCheckpoint(i);
   				SetPlayerRaceCheckpoint(i,2,Mgame1CP[randomss][0], Mgame1CP[randomss][1], Mgame1CP[randomss][2],
     			0,0,0,15);
	    	}
		}
    }
I just want to add 1 to MCP when player enters a CheckPoint. Please help me.
Reply
#2

It should be +=
pawn Код:
mcp[playerid] +=1;
//Or you could just use ++ (Your choise)
mcp[playerid] ++;
Reply
#3

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)