\BPS.pwn(113374) : error 017: undefined symbol "minutoss" \BPS.pwn(113374) : warning 215: expression has no effect \BPS.pwn(113374) : error 001: expected token: ";", but found "]" \BPS.pwn(113374) : error 029: invalid expression, assumed zero \BPS.pwn(113374) : fatal error 107: too many error messages on one line[/COLOR]
forward RelogioUPs(playerid); public RelogioUPs(playerid) { minutoss[playerid] ++; TempoPayday[playerid]--; new string[50]; if(minutos[playerid] >= 59); { minutoss[playerid] = 0; countando ++; TempoPayday[playerid] = 59; } switch(countando) { case 1: format(string, 50,"Payday: 59:%d", TempoPayday[playerid]); case 2: format(string, 50,"Payday: 58:%d", TempoPayday[playerid]); case 3: format(string, 50,"Payday: 57:%d", TempoPayday[playerid]); case 4: format(string, 50,"Payday: 56:%d", TempoPayday[playerid]); case 5: format(string, 50,"Payday: 55:%d", TempoPayday[playerid]); case 6: format(string, 50,"Payday: 54:%d", TempoPayday[playerid]); case 7: format(string, 50,"Payday: 53:%d", TempoPayday[playerid]); case 8: format(string, 50,"Payday: 52:%d", TempoPayday[playerid]); case 9: format(string, 50,"Payday: 51:%d", TempoPayday[playerid]); case 10: format(string, 50,"Payday: 50:%d", TempoPayday[playerid]); case 11: format(string, 50,"Payday: 49:%d", TempoPayday[playerid]); case 12: format(string, 50,"Payday: 48:%d", TempoPayday[playerid]); case 13: format(string, 50,"Payday: 47:%d", TempoPayday[playerid]); case 14: format(string, 50,"Payday: 46:%d", TempoPayday[playerid]); case 15: format(string, 50,"Payday: 45:%d", TempoPayday[playerid]); case 16: format(string, 50,"Payday: 44:%d", TempoPayday[playerid]); case 17: format(string, 50,"Payday: 43:%d", TempoPayday[playerid]); case 18: format(string, 50,"Payday: 42:%d", TempoPayday[playerid]); case 19: format(string, 50,"Payday: 41:%d", TempoPayday[playerid]); case 20: format(string, 50,"Payday: 40:%d", TempoPayday[playerid]); case 21: format(string, 50,"Payday: 39:%d", TempoPayday[playerid]); case 22: format(string, 50,"Payday: 38:%d", TempoPayday[playerid]); case 23: format(string, 50,"Payday: 37:%d", TempoPayday[playerid]); case 24: format(string, 50,"Payday: 36:%d", TempoPayday[playerid]); case 25: format(string, 50,"Payday: 35:%d", TempoPayday[playerid]); case 26: format(string, 50,"Payday: 34:%d", TempoPayday[playerid]); case 27: format(string, 50,"Payday: 33:%d", TempoPayday[playerid]); case 28: format(string, 50,"Payday: 32:%d", TempoPayday[playerid]); case 29: format(string, 50,"Payday: 31:%d", TempoPayday[playerid]); case 30: format(string, 50,"Payday: 30:%d", TempoPayday[playerid]); case 31: format(string, 50,"Payday: 29:%d", TempoPayday[playerid]); case 32: format(string, 50,"Payday: 28:%d", TempoPayday[playerid]); case 33: format(string, 50,"Payday: 27:%d", TempoPayday[playerid]); case 34: format(string, 50,"Payday: 26:%d", TempoPayday[playerid]); case 35: format(string, 50,"Payday: 25:%d", TempoPayday[playerid]); case 36: format(string, 50,"Payday: 24:%d", TempoPayday[playerid]); case 37: format(string, 50,"Payday: 23:%d", TempoPayday[playerid]); case 38: format(string, 50,"Payday: 22:%d", TempoPayday[playerid]); case 39: format(string, 50,"Payday: 21:%d", TempoPayday[playerid]); case 40: format(string, 50,"Payday: 20:%d", TempoPayday[playerid]); case 41: format(string, 50,"Payday: 19:%d", TempoPayday[playerid]); case 42: format(string, 50,"Payday: 18:%d", TempoPayday[playerid]); case 43: format(string, 50,"Payday: 17:%d", TempoPayday[playerid]); case 44: format(string, 50,"Payday: 16:%d", TempoPayday[playerid]); case 45: format(string, 50,"Payday: 15:%d", TempoPayday[playerid]); case 46: format(string, 50,"Payday: 14:%d", TempoPayday[playerid]); case 47: format(string, 50,"Payday: 13:%d", TempoPayday[playerid]); case 48: format(string, 50,"Payday: 12:%d", TempoPayday[playerid]); case 49: format(string, 50,"Payday: 11:%d", TempoPayday[playerid]); case 50: format(string, 50,"Payday: 10:%d", TempoPayday[playerid]); case 51: format(string, 50,"Payday: 9:%d", TempoPayday[playerid]); case 52: format(string, 50,"Payday: 8:%d", TempoPayday[playerid]); case 53: format(string, 50,"Payday: 7:%d", TempoPayday[playerid]); case 54: format(string, 50,"Payday: 6:%d", TempoPayday[playerid]); case 55: format(string, 50,"Payday: 5:%d", TempoPayday[playerid]); case 56: format(string, 50,"Payday: 4:%d", TempoPayday[playerid]); case 57: format(string, 50,"Payday: 3:%d", TempoPayday[playerid]); case 58: format(string, 50,"Payday: 2:%d", TempoPayday[playerid]); case 59: format(string, 50,"Payday: 1:%d", TempoPayday[playerid]); } TextDrawSetString(ReloginhoUP,string); TextDrawShowForAll(ReloginhoUP); if(countando == 59) { countando = 1; @PayDay(playerID); } return 1; }
new minutoss[MAX_PLAYERS];
new MinutosP[MAX_PLAYERS], SegundosP[MAX_PLAYERS], Text: Textdraw0[MAX_PLAYERS];//variavel minutos e segundos do payday.
public OnPlayerConnect(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
SetTimerEx("RelogioUP", 1000, true, "i", i);
Textdraw0[i] = TextDrawCreate(499.000000, 123.000000, "");
TextDrawBackgroundColor(Textdraw0[i], 255);
TextDrawFont(Textdraw0[i], 1);
TextDrawLetterSize(Textdraw0[i], 0.450000, 0.899999);
TextDrawColor(Textdraw0[i], -16776961);
TextDrawSetOutline(Textdraw0[i], 0);
TextDrawSetProportional(Textdraw0[i], 0);
TextDrawSetShadow(Textdraw0[i], 1);
TextDrawSetSelectable(Textdraw0[i], 0);
}
MinutosP[playerid] = DOF2_GetInt(Conta, "Minutos Payday");//Carregar Minutos
SegundosP[playerid] = DOF2_GetInt(Conta, "Segundos Payday");//Carregar Segundos
return 1;
}
public OnplayerDisconnect(playerid, reason)
{
DOF2_SetInt(Conta, "Minutos Payday", MinutosP[playerid]);//Salvar Minutos
DOF2_SetInt(Conta, "Segundos Payday", SegundosP[playerid]);//Salvar Segundos
return 1;
}
forward RelogioUP(playerid);//Em algum lugar da sua GM.
public RelogioUP(playerid)//Em algum lugar da sua GM.
{
if(MinutosP[playerid] == 0 && SegundosP[playerid] == 0)
{
MinutosP[playerid] = 59;
SegundosP[playerid] = 59;
@PayDay(playerID);//aqui й a funзгo que libera o pagamento.
}
if(SegundosP[playerid] == -1)
{
if(MinutosP[playerid] == 0)
MinutosP[playerid] = 59;
SegundosP[playerid] = 59;
MinutosP[playerid]--;
}
new string[128];
format(string, sizeof(string), "Payday:~w~%02dm e %02ds", MinutosP[playerid], SegundosP[playerid]);
TextDrawSetString(Textdraw0[playerid],string);
TextDrawShowForPlayer(playerid, Textdraw0[playerid]);
SegundosP[playerid] --;
return 1;
}
Bom pessoal eu nгo entendo muito sobre pawno e estou aprendendo aos poucos com videos de *******r, apostilas de alguns sites entre outos. Eu estou tentando colocar esse cуdgio que achei aqui no forum em minha GM porйm estб dando 4 erros muitos chatos que nгo consegui resolver ainda.
|
Se gostar deixe um rep e recomendo a vocк usar esse bem facil de entender.
PHP код:
|
\BPF.pwn(118515) : error 021: symbol already defined: "SetTimerEx" \BPF.pwn(118528) : error 010: invalid function or declaration \BPF.pwn(118533) : error 017: undefined symbol "Conta" \BPF.pwn(118534) : error 017: undefined symbol "Conta" \BPF.pwn(118545) : error 017: undefined symbol "@PayDay"
#define Conta "Contas/%s.ini"
new MinutosP[MAX_PLAYERS], SegundosP[MAX_PLAYERS], Text: Textdraw0[MAX_PLAYERS];//variavel minutos e segundos do payday.
public OnPlayerConnect(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
SetTimerEx("RelogioUP", 1000, true, "i", i);
Textdraw0[i] = TextDrawCreate(499.000000, 123.000000, "");
TextDrawBackgroundColor(Textdraw0[i], 255);
TextDrawFont(Textdraw0[i], 1);
TextDrawLetterSize(Textdraw0[i], 0.450000, 0.899999);
TextDrawColor(Textdraw0[i], -16776961);
TextDrawSetOutline(Textdraw0[i], 0);
TextDrawSetProportional(Textdraw0[i], 0);
TextDrawSetShadow(Textdraw0[i], 1);
TextDrawSetSelectable(Textdraw0[i], 0);
}
MinutosP[playerid] = DOF2_GetInt(Conta, "Minutos Payday");//Carregar Minutos
SegundosP[playerid] = DOF2_GetInt(Conta, "Segundos Payday");//Carregar Segundos
return 1;
}
public OnplayerDisconnect(playerid, reason)
{
DOF2_SetInt(Conta, "Minutos Payday", MinutosP[playerid]);//Salvar Minutos
DOF2_SetInt(Conta, "Segundos Payday", SegundosP[playerid]);//Salvar Segundos
return 1;
}
forward RelogioUP(playerid);//Em algum lugar da sua GM.
public RelogioUP(playerid)//Em algum lugar da sua GM.
{
if(MinutosP[playerid] == 0 && SegundosP[playerid] == 0)
{
MinutosP[playerid] = 59;
SegundosP[playerid] = 59;
PayDay(playerid);//aqui й a funзгo que libera o pagamento.
}
if(SegundosP[playerid] == -1)
{
if(MinutosP[playerid] == 0)
MinutosP[playerid] = 59;
SegundosP[playerid] = 59;
MinutosP[playerid]--;
}
new string[128];
format(string, sizeof(string), "Payday:~w~%02dm e %02ds", MinutosP[playerid], SegundosP[playerid]);
TextDrawSetString(Textdraw0[playerid],string);
TextDrawShowForPlayer(playerid, Textdraw0[playerid]);
SegundosP[playerid] --;
return 1;
}
PHP код:
Pasta_Contas "Contas/%s.ini" No erro do "SettimerEx" Vocк deve ter definido ele duas vezes ! |
#define Conta "Contas/%s.ini"
new MinutosP[MAX_PLAYERS],
SegundosP[MAX_PLAYERS],
PlayerText:Textdraw0[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
new file[40], NomePl[MAX_PLAYER_NAME];
GetPlayerName(playerid, NomePl, sizeof NomePl);
format(file, sizeof file, Conta, NomePl);
if(DOF2_FileExists(file))
{
MinutosP[playerid] = DOF2_GetInt(file, "Minutos");
SegundosP[playerid] = DOF2_GetInt(file, "Segundos");
}
Textdraw0[playerid] = CreatePlayerTextDraw(playerid, 499.000000, 123.000000, "");
PlayerTextDrawBackgroundColor(playerid, Textdraw0[playerid], 255);
PlayerTextDrawFont(playerid, Textdraw0[playerid], 1);
PlayerTextDrawLetterSize(playerid, Textdraw0[playerid], 0.450000, 0.899999);
PlayerTextDrawColor(playerid, Textdraw0[playerid], -16776961);
PlayerTextDrawSetOutline(playerid, Textdraw0[playerid], 0);
PlayerTextDrawSetProportional(playerid, Textdraw0[playerid], 0);
PlayerTextDrawSetShadow(playerid, Textdraw0[playerid], 1);
PlayerTextDrawSetSelectable(playerid, Textdraw0[playerid], 0);
return 1;
}
/*
* @OBS - Vocк precisa adicionar o codigo abaixo na funзгo onde o player faz o login
*/
forward OnPlayerLogin(playerid);
public OnPlayerLogin(playerid)
{
PlayerTextDrawShow(playerid, textdraw0[playerid]);
}
public OnPlayerDisconnect(playerid, reason)
{
new file[40], NomePl[MAX_PLAYER_NAME];
GetPlayerName(playerid, NomePl, sizeof NomePl);
format(file, sizeof file, Conta, NomePl);
if(DOF2_FileExists(file))
{
DOF2_SetInt(Conta, "Minutos", MinutosP[playerid]);
DOF2_SetInt(Conta, "Segundos", SegundosP[playerid]);
}
return 1;
}
public OnGameModeInit()
{
SetTimer("RelogioUP", 1000, true);
}
forward RelogioUP();
public RelogioUP()
{
foreach(new playerid: Player)
{
if(MinutosP[playerid] <= 0 && SegundosP[playerid] <= 0)
{
MinutosP[playerid] = 60;
SegundosP[playerid] = 0;
Payday(playerid); // << Taca o Payday
}
else
{
if(SegundosP[playerid] <= 0)
{
MinutosP[playerid]--;
SegundosP[playerid] = 60;
}
else
SegundosP[playerid]--;
}
new text[30];
format(text, sizeof text, "Payday:~w~%02d:%02d", MinutosP[playerid], SegundosP[playerid]);
PlayerTextDrawSetString(playerid, textdraw0[playerid], text);
//Se colocar pra aparecer a textdraw aqui vai aparecer na tela de login tambйm, mas se quiser:
PlayerTextDrawShow(playerid, textdraw0[playerid]);
}
return true;
}
Por que a textdraw ta sendo criada na callback do OnPlayerConnect? cada vez que o jogador conectava no servidor setava um timer em todo mundo e criava a textdraw pra todo mundo ? seria melhor assim(AO MEU VER)
PHP код:
|