new Stats[MAX_PLAYERS];
new Float:Checkpoints[4][3] = //4 = 4 coordenadas | 3 = 3 "valores" (X,Y,Z)
{
{X,Y,Z},
{X,Y,Z},
{X,Y,Z},
{X,Y,Z}
};
if(strcmp(cmdtext, "/partida", true) == 0)
{
if(IsPlayerAdmin(playerid))
{
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
SetPlayerRaceCheckpoint(i, 0, Checkpoints[1][1], Checkpoints[1][2], Checkpoints[1][3], Checkpoints[2][1], Checkpoints[2][2], Checkpoints[2][3], 10);
Stats[i] = 1;
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Apenas Para Admins");
}
}
Checkpoints[1][1] ---> Coordenada 1, valor 1 Checkpoints[1][2] ---> Coordenada 1, valor 2 Checkpoints[1][3] ---> Coordenada 1, valor 3 .....
{
switch(Stats[playerid])
{
case 1:
{
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[2][1], Checkpoints[2][2], Checkpoints[2][3], Checkpoints[3][1], Checkpoints[3][2], Checkpoints[3][3], 10);
Stats[i] = 2;
return 1;
}
case 2:
{
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[3][1], Checkpoints[3][2], Checkpoints[3][3], Checkpoints[4][1], Checkpoints[4][2], Checkpoints[4][3], 10);
Stats[i] = 3;
return 1;
}
case 3:
{
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[4][1], Checkpoints[4][2], Checkpoints[4][3], Checkpoints[4][1], Checkpoints[4][2], Checkpoints[4][3]-5, 10);
Stats[i] = 4;
return 1;
}
case 4:
{
DisablePlayerRaceCheckpoint(playerid);
GameTextForPlayer(playerid, "You have won the race!!", 3000, 1);
GivePlayerMoney(playerid, 10000);
return 1;
}
}
}
DisablePlayerRaceCheckpoint(playerid); ----> Tira os CP's jб existentes SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[2][1], Checkpoints[2][2], Checkpoints[2][3], Checkpoints[3][1], Checkpoints[3][2], Checkpoints[3][3], 10); Cria um novo CP GameTextForPlayer(playerid, "You have won the race!!", 3000, 1); ---> Indica que o Player Ganhou a corrida
Originally Posted by andmeida10
n vi ao promenor, mas parece tar be,
|
new Stats[MAX_PLAYERS]; new CheckPoints[12][3] = //4 = 4 coordenadas | 3 = 3 "valores" (X,Y,Z) { {3116.8188,-2054.5698,3.5096}, {3125.7852,-1768.5270,3.5096}, {3345.8813,-1770.8011,5.4053}, {3477.7815,-1811.6428,3.4826}, {3620.3569,-1988.3201,5.6010}, {3517.7246,-2004.3265,3.4800}, {3508.9717,-2166.2795,3.4780}, {3501.0178,-2393.7158,3.4574}, {3406.2468,-2494.4087,3.4574}, {3310.3005,-2359.6292,3.4574}, {3118.5750,-2352.3428,3.4574}, {3124.1780,-2053.6074,3.4574} }; //public OnPlayerCommandText(playerid, cmdtext[]) //{ if(strcmp(cmdtext, "/corrida", true) == 0) { if(IsPlayerAdmin(playerid)) { for(new i = 0; i < GetMaxPlayers(); i++) { if(IsPlayerConnected(i)) { SetPlayerRaceCheckpoint(i, 0, Checkpoints[1][1], Checkpoints[1][2], Checkpoints[1][3], Checkpoints[2][1], Checkpoints[2][2], Checkpoints[2][3], 10); Stats[i] = 1; return 1; } } } else { SendClientMessage(playerid, COLOR_RED, "Apenas Para Admins"); } } //public OnPlayerEnterCheckpoint(playerid) //{ switch(Stats[playerid]) { case 1: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[2][1], Checkpoints[2][2], Checkpoints[2][3], Checkpoints[3][1], Checkpoints[3][2], Checkpoints[3][3], 10); Stats[i] = 2; return 1; } case 2: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[3][1], Checkpoints[3][2], Checkpoints[3][3], Checkpoints[4][1], Checkpoints[4][2], Checkpoints[4][3], 10); Stats[i] = 3; return 1; } case 3: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[4][1], Checkpoints[4][2], Checkpoints[4][3], Checkpoints[4][1], Checkpoints[4][2], Checkpoints[4][3]-5, 10); Stats[i] = 4; return 1; } case 4: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[5][1], Checkpoints[5][2], Checkpoints[5][3], Checkpoints[5][1], Checkpoints[5][2], Checkpoints[5][3]-5, 10); Stats[i] = 5; return 1; } case 5: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[6][1], Checkpoints[6][2], Checkpoints[6][3], Checkpoints[6][1], Checkpoints[6][2], Checkpoints[6][3]-5, 10); Stats[i] = 6; return 1; } case 6: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[7][1], Checkpoints[7][2], Checkpoints[7][3], Checkpoints[7][1], Checkpoints[7][2], Checkpoints[7][3]-5, 10); Stats[i] = 7; return 1; } case 7: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[8][1], Checkpoints[8][2], Checkpoints[8][3], Checkpoints[8][1], Checkpoints[8][2], Checkpoints[8][3]-5, 10); Stats[i] = 8; return 1; } case 8: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[9][1], Checkpoints[9][2], Checkpoints[9][3], Checkpoints[9][1], Checkpoints[9][2], Checkpoints[9][3]-5, 10); Stats[i] = 9; return 1; } case 9: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[10][1], Checkpoints[10][2], Checkpoints[10][3], Checkpoints[10][1], Checkpoints[10][2], Checkpoints[10][3]-5, 10); Stats[i] = 10; return 1; } case 10: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[11][1], Checkpoints[11][2], Checkpoints[11][3], Checkpoints[11][1], Checkpoints[11][2], Checkpoints[11][3]-5, 10); Stats[i] = 11; return 1; } case 11: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[12][1], Checkpoints[12][2], Checkpoints[12][3], Checkpoints[12][1], Checkpoints[12][2], Checkpoints[12][3]-5, 10); Stats[i] = 12; return 1; } case 12: { DisablePlayerRaceCheckpoint(playerid); GameTextForPlayer(playerid, "~b~Voce ~y~ganhou ~w~a ~r~corrida~w~, e ~g~ganhou $10000 ~w~por isso!", 3000, 1); GivePlayerMoney(playerid, 10000); return 1; } } }
Originally Posted by lomato
Code:
new Stats[MAX_PLAYERS]; new CheckPoints[12][3] = //4 = 4 coordenadas | 3 = 3 "valores" (X,Y,Z) { {3116.8188,-2054.5698,3.5096}, {3125.7852,-1768.5270,3.5096}, {3345.8813,-1770.8011,5.4053}, {3477.7815,-1811.6428,3.4826}, {3620.3569,-1988.3201,5.6010}, {3517.7246,-2004.3265,3.4800}, {3508.9717,-2166.2795,3.4780}, {3501.0178,-2393.7158,3.4574}, {3406.2468,-2494.4087,3.4574}, {3310.3005,-2359.6292,3.4574}, {3118.5750,-2352.3428,3.4574}, {3124.1780,-2053.6074,3.4574} }; //public OnPlayerCommandText(playerid, cmdtext[]) //{ if(strcmp(cmdtext, "/corrida", true) == 0) { if(IsPlayerAdmin(playerid)) { for(new i = 0; i < GetMaxPlayers(); i++) { if(IsPlayerConnected(i)) { SetPlayerRaceCheckpoint(i, 0, Checkpoints[1][1], Checkpoints[1][2], Checkpoints[1][3], Checkpoints[2][1], Checkpoints[2][2], Checkpoints[2][3], 10); Stats[i] = 1; return 1; } } } else { SendClientMessage(playerid, COLOR_RED, "Apenas Para Admins"); } } //public OnPlayerEnterCheckpoint(playerid) //{ switch(Stats[playerid]) { case 1: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[2][1], Checkpoints[2][2], Checkpoints[2][3], Checkpoints[3][1], Checkpoints[3][2], Checkpoints[3][3], 10); Stats[i] = 2; return 1; } case 2: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[3][1], Checkpoints[3][2], Checkpoints[3][3], Checkpoints[4][1], Checkpoints[4][2], Checkpoints[4][3], 10); Stats[i] = 3; return 1; } case 3: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[4][1], Checkpoints[4][2], Checkpoints[4][3], Checkpoints[4][1], Checkpoints[4][2], Checkpoints[4][3]-5, 10); Stats[i] = 4; return 1; } case 4: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[5][1], Checkpoints[5][2], Checkpoints[5][3], Checkpoints[5][1], Checkpoints[5][2], Checkpoints[5][3]-5, 10); Stats[i] = 5; return 1; } case 5: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[6][1], Checkpoints[6][2], Checkpoints[6][3], Checkpoints[6][1], Checkpoints[6][2], Checkpoints[6][3]-5, 10); Stats[i] = 6; return 1; } case 6: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[7][1], Checkpoints[7][2], Checkpoints[7][3], Checkpoints[7][1], Checkpoints[7][2], Checkpoints[7][3]-5, 10); Stats[i] = 7; return 1; } case 7: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[8][1], Checkpoints[8][2], Checkpoints[8][3], Checkpoints[8][1], Checkpoints[8][2], Checkpoints[8][3]-5, 10); Stats[i] = 8; return 1; } case 8: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[9][1], Checkpoints[9][2], Checkpoints[9][3], Checkpoints[9][1], Checkpoints[9][2], Checkpoints[9][3]-5, 10); Stats[i] = 9; return 1; } case 9: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[10][1], Checkpoints[10][2], Checkpoints[10][3], Checkpoints[10][1], Checkpoints[10][2], Checkpoints[10][3]-5, 10); Stats[i] = 10; return 1; } case 10: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[11][1], Checkpoints[11][2], Checkpoints[11][3], Checkpoints[11][1], Checkpoints[11][2], Checkpoints[11][3]-5, 10); Stats[i] = 11; return 1; } case 11: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[12][1], Checkpoints[12][2], Checkpoints[12][3], Checkpoints[12][1], Checkpoints[12][2], Checkpoints[12][3]-5, 10); Stats[i] = 12; return 1; } case 12: { DisablePlayerRaceCheckpoint(playerid); GameTextForPlayer(playerid, "~b~Voce ~y~ganhou ~w~a ~r~corrida~w~, e ~g~ganhou $10000 ~w~por isso!", 3000, 1); GivePlayerMoney(playerid, 10000); return 1; } } } |
new Checkpoints[4][3] = //4 = 4 coordenadas | 3 = 3 "valores" (X,Y,Z)
new Float:Checkpoints[4][3] = //4 = 4 coordenadas | 3 = 3 "valores" (X,Y,Z)
C:\DOCUME~1\SEUNOM~1\Desktop\COLOCA~1\CMD03V~1.0\GAMEMO~1\gangster.pwn(448) : error 017: undefined symbol "Checkpoint"
C:\DOCUME~1\SEUNOM~1\Desktop\COLOCA~1\CMD03V~1.0\GAMEMO~1\gangster.pwn(448) : warning 215: expression has no effect
C:\DOCUME~1\SEUNOM~1\Desktop\COLOCA~1\CMD03V~1.0\GAMEMO~1\gangster.pwn(448) : error 001: expected token: ";", but found "]"
C:\DOCUME~1\SEUNOM~1\Desktop\COLOCA~1\CMD03V~1.0\GAMEMO~1\gangster.pwn(448) : error 029: invalid expression, assumed zero
C:\DOCUME~1\SEUNOM~1\Desktop\COLOCA~1\CMD03V~1.0\GAMEMO~1\gangster.pwn(448) : 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.
SetPlayerRaceCheckpoint(i, 0, Checkpoint[1][1], Checkpoint[1][2], Checkpoint[1][3], Checkpoint[2][1], Checkpoint[2][2], Checkpoint[2][3], 10);
Originally Posted by russooooo
Na array multidimensional(acho que й assim o nome, ou estou errado. lol) estб Checkpoints nгo Checkpoint.
|
Originally Posted by andmeida10
Quote:
|
Originally Posted by andmeida10
new Float:Checkpoints[4][3] = //4 = 4 coordenadas | 3 = 3 "valores" (X,Y,Z)
{ {X,Y,Z}, {X,Y,Z}, {X,Y,Z}, {X,Y,Z} }; |
Originally Posted by Comando_DS
Linha do Erro
SetPlayerRaceCheckpoint(i, 0, Checkpoint[1][1], Checkpoint[1][2], Checkpoint[1][3], Checkpoint[2][1], Checkpoint[2][2], Checkpoint[2][3], 10); |
Originally Posted by russooooo
Na array multidimensional(acho que й assim o nome, ou estou errado. lol) estб Checkpoints nгo Checkpoint.
|