Sistema de Patente -
maxblaya01 - 12.08.2015
Criei um sistema de patente mais ele so atualiza se eu relogar no servidor, tem como ele atualizar na mesma hora que eu atingir o tanto de score?
Quote:
#include <a_samp>
//News
new Text:TextPatente;
public OnFilterScriptInit()
{
TextPatente = TextDrawCreate(40.000000,322.000000,"]Patente: "); //Crie sua textdraw
TextDrawAlignment(TextPatente,0);
TextDrawBackgroundColor(TextPatente,0x000000ff);
TextDrawFont(TextPatente,2);
TextDrawLetterSize(TextPatente,0.199999,1.500000);
TextDrawColor(TextPatente,0x00ff00ff);
TextDrawSetProportional(TextPatente,1);
TextDrawSetShadow(TextPatente,1);
TextDrawSetOutline(TextPatente, 1);
return 1;
}
public OnPlayerSpawn(playerid)
{
new str[50];
if(GetPlayerScore(playerid) >= 10)
{
format(str, sizeof(str), "~g~Patente: ~w~Novato");
TextDrawSetString(TextPatente, str);
}
if(GetPlayerScore(playerid) >= 300)
{
format(str, sizeof(str), "~g~Patente: ~w~mediano");
TextDrawSetString(TextPatente, str);
}
if(GetPlayerScore(playerid) >= 600)
{
format(str, sizeof(str), "~g~Patente: ~w~amador");
TextDrawSetString(TextPatente, str);
}
if(GetPlayerScore(playerid) >= 1000)
{
format(str, sizeof(str), "~g~Patente: ~w~master");
TextDrawSetString(TextPatente, str);
}
TextDrawShowForPlayer(playerid, TextPatente);
return 1;
}
|
Re: Sistema de Patente -
Lуs - 12.08.2015
PHP код:
public OnPlayerDeath(playerid, killerid, reason)
{
new str[50];
if(GetPlayerScore(killerid) >= 10)
{
format(str, sizeof(str), "~g~Patente: ~w~Novato");
TextDrawSetString(TextPatente, str);
}
if(GetPlayerScore(killerid) >= 300)
{
format(str, sizeof(str), "~g~Patente: ~w~mediano");
TextDrawSetString(TextPatente, str);
}
if(GetPlayerScore(killerid) >= 600)
{
format(str, sizeof(str), "~g~Patente: ~w~amador");
TextDrawSetString(TextPatente, str);
}
if(GetPlayerScore(killerid) >= 1000)
{
format(str, sizeof(str), "~g~Patente: ~w~master");
TextDrawSetString(TextPatente, str);
}
return 1;
}
Re: Sistema de Patente -
maxblaya01 - 12.08.2015
Quote:
Originally Posted by Lуs
PHP код:
public OnPlayerDeath(playerid, killerid, reason)
{
new str[50];
if(GetPlayerScore(killerid) >= 10)
{
format(str, sizeof(str), "~g~Patente: ~w~Novato");
TextDrawSetString(TextPatente, str);
}
if(GetPlayerScore(killerid) >= 300)
{
format(str, sizeof(str), "~g~Patente: ~w~mediano");
TextDrawSetString(TextPatente, str);
}
if(GetPlayerScore(killerid) >= 600)
{
format(str, sizeof(str), "~g~Patente: ~w~amador");
TextDrawSetString(TextPatente, str);
}
if(GetPlayerScore(killerid) >= 1000)
{
format(str, sizeof(str), "~g~Patente: ~w~master");
TextDrawSetString(TextPatente, str);
}
return 1;
}
|
era so mudar la em cima?
Re: Sistema de Patente -
99fe3rnando - 12.08.2015
Quote:
Originally Posted by maxblaya01
era so mudar la em cima?
|
nгo muda nada sу adiciona, se vocк mudar nгo vai aparecer o textdraw quando o player conectar
Re: Sistema de Patente -
maxblaya01 - 14.08.2015
Quote:
Originally Posted by Lуs
PHP код:
public OnPlayerDeath(playerid, killerid, reason)
{
new str[50];
if(GetPlayerScore(killerid) >= 10)
{
format(str, sizeof(str), "~g~Patente: ~w~Novato");
TextDrawSetString(TextPatente, str);
}
if(GetPlayerScore(killerid) >= 300)
{
format(str, sizeof(str), "~g~Patente: ~w~mediano");
TextDrawSetString(TextPatente, str);
}
if(GetPlayerScore(killerid) >= 600)
{
format(str, sizeof(str), "~g~Patente: ~w~amador");
TextDrawSetString(TextPatente, str);
}
if(GetPlayerScore(killerid) >= 1000)
{
format(str, sizeof(str), "~g~Patente: ~w~master");
TextDrawSetString(TextPatente, str);
}
return 1;
}
|
quando eu coloco em public OnPlayerDeath , ae some o textdraw '-' , porque sera?
Re: Sistema de Patente -
iTakelot - 14.08.2015
PHP код:
#include a_samp
new PlayerText:TakelotP[MAX_PLAYERS];
#if defined FILTERSCRIPT
#else
public OnFilterScriptInit(){return print("\n||FILTERSCRIPT BY: iTakelot PATENTE LIGADO||\n");}
public OnFilterScriptExit(){return print("\n||FILTERSCRIPT BY: iTakelot PATENTE DESLIGADO||\n");}
#endif
public OnPlayerConnect(playerid)
{
TakelotP[playerid] = CreatePlayerTextDraw(playerid, 40.000000,322.000000,"Patente: "); //Crie sua textdraw
PlayerTextDrawAlignment(playerid, TakelotP[playerid],0);
PlayerTextDrawBackgroundColor(playerid,TakelotP[playerid],0x000000ff);
PlayerTextDrawFont(playerid,TakelotP[playerid],2);
PlayerTextDrawLetterSize(playerid,TakelotP[playerid],0.199999,1.500000);
PlayerTextDrawColor(playerid,TakelotP[playerid],0x00ff00ff);
PlayerTextDrawSetProportional(playerid,TakelotP[playerid],1);
PlayerTextDrawSetShadow(playerid, TakelotP[playerid],1);
PlayerTextDrawSetOutline(playerid, TakelotP[playerid], 1);
PlayerTextDrawShowForPlayer(playerid, TakelotP);
return 1;
}
public OnPlayerUpdate(playerid)
{
new str[50];
if(GetPlayerScore(playerid) >= 10){
format(str, sizeof(str), "~g~Patente: ~w~Novato");
PlayerTextDrawSetString(playerid,TakelotP[playerid], str);}
if(GetPlayerScore(playerid) >= 300){
format(str, sizeof(str), "~g~Patente: ~w~mediano");
PlayerTextDrawSetString(playerid,TakelotP[playerid], str);}
if(GetPlayerScore(playerid) >= 600){
format(str, sizeof(str), "~g~Patente: ~w~amador");
PlayerTextDrawSetString(playerid,TakelotP[playerid], str);}
if(GetPlayerScore(playerid) >= 1000){
format(str, sizeof(str), "~g~Patente: ~w~master");
PlayerTextDrawSetString(playerid,TakelotP[playerid], str);}
return 1;
}
Re: Sistema de Patente -
maxblaya01 - 15.08.2015
Quote:
Originally Posted by iTakelot
PHP код:
#include a_samp
new PlayerText:TakelotP[MAX_PLAYERS];
#if defined FILTERSCRIPT
#else
public OnFilterScriptInit(){return print("\n||FILTERSCRIPT BY: iTakelot PATENTE LIGADO||\n");}
public OnFilterScriptExit(){return print("\n||FILTERSCRIPT BY: iTakelot PATENTE DESLIGADO||\n");}
#endif
public OnPlayerConnect(playerid)
{
TakelotP[playerid] = CreatePlayerTextDraw(playerid, 40.000000,322.000000,"Patente: "); //Crie sua textdraw
PlayerTextDrawAlignment(playerid, TakelotP[playerid],0);
PlayerTextDrawBackgroundColor(playerid,TakelotP[playerid],0x000000ff);
PlayerTextDrawFont(playerid,TakelotP[playerid],2);
PlayerTextDrawLetterSize(playerid,TakelotP[playerid],0.199999,1.500000);
PlayerTextDrawColor(playerid,TakelotP[playerid],0x00ff00ff);
PlayerTextDrawSetProportional(playerid,TakelotP[playerid],1);
PlayerTextDrawSetShadow(playerid, TakelotP[playerid],1);
PlayerTextDrawSetOutline(playerid, TakelotP[playerid], 1);
PlayerTextDrawShowForPlayer(playerid, TakelotP);
return 1;
}
public OnPlayerUpdate(playerid)
{
new str[50];
if(GetPlayerScore(playerid) >= 10){
format(str, sizeof(str), "~g~Patente: ~w~Novato");
PlayerTextDrawSetString(playerid,TakelotP[playerid], str);}
if(GetPlayerScore(playerid) >= 300){
format(str, sizeof(str), "~g~Patente: ~w~mediano");
PlayerTextDrawSetString(playerid,TakelotP[playerid], str);}
if(GetPlayerScore(playerid) >= 600){
format(str, sizeof(str), "~g~Patente: ~w~amador");
PlayerTextDrawSetString(playerid,TakelotP[playerid], str);}
if(GetPlayerScore(playerid) >= 1000){
format(str, sizeof(str), "~g~Patente: ~w~master");
PlayerTextDrawSetString(playerid,TakelotP[playerid], str);}
return 1;
}
|
como corrijo esse ERRO:
C:\Users\Max\Desktop\p.pwn(25) : error 017: undefined symbol "PlayerTextDrawShowForPlayer"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
Re: Sistema de Patente -
iTakelot - 15.08.2015
sorry ^^, foi um erro de digitaзгo meu substitue a linha do erro por isso:
PHP код:
PlayerTextDrawShow(playerid, PlayerText:TakelotP[playerid]);
Re: Sistema de Patente -
Lуs - 15.08.2015
Quote:
Originally Posted by maxblaya01
como corrijo esse ERRO:
C:\Users\Max\Desktop\p.pwn(25) : error 017: undefined symbol "PlayerTextDrawShowForPlayer"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
|
Re: Sistema de Patente -
Thider - 15.08.2015
Quote:
Originally Posted by iTakelot
PHP код:
#include a_samp
new PlayerText:TakelotP[MAX_PLAYERS];
#if defined FILTERSCRIPT
#else
public OnFilterScriptInit(){return print("\n||FILTERSCRIPT BY: iTakelot PATENTE LIGADO||\n");}
public OnFilterScriptExit(){return print("\n||FILTERSCRIPT BY: iTakelot PATENTE DESLIGADO||\n");}
#endif
public OnPlayerConnect(playerid)
{
TakelotP[playerid] = CreatePlayerTextDraw(playerid, 40.000000,322.000000,"Patente: "); //Crie sua textdraw
PlayerTextDrawAlignment(playerid, TakelotP[playerid],0);
PlayerTextDrawBackgroundColor(playerid,TakelotP[playerid],0x000000ff);
PlayerTextDrawFont(playerid,TakelotP[playerid],2);
PlayerTextDrawLetterSize(playerid,TakelotP[playerid],0.199999,1.500000);
PlayerTextDrawColor(playerid,TakelotP[playerid],0x00ff00ff);
PlayerTextDrawSetProportional(playerid,TakelotP[playerid],1);
PlayerTextDrawSetShadow(playerid, TakelotP[playerid],1);
PlayerTextDrawSetOutline(playerid, TakelotP[playerid], 1);
PlayerTextDrawShowForPlayer(playerid, TakelotP);
return 1;
}
public OnPlayerUpdate(playerid)
{
new str[50];
if(GetPlayerScore(playerid) >= 10){
format(str, sizeof(str), "~g~Patente: ~w~Novato");
PlayerTextDrawSetString(playerid,TakelotP[playerid], str);}
if(GetPlayerScore(playerid) >= 300){
format(str, sizeof(str), "~g~Patente: ~w~mediano");
PlayerTextDrawSetString(playerid,TakelotP[playerid], str);}
if(GetPlayerScore(playerid) >= 600){
format(str, sizeof(str), "~g~Patente: ~w~amador");
PlayerTextDrawSetString(playerid,TakelotP[playerid], str);}
if(GetPlayerScore(playerid) >= 1000){
format(str, sizeof(str), "~g~Patente: ~w~master");
PlayerTextDrawSetString(playerid,TakelotP[playerid], str);}
return 1;
}
|
И realmente necessбrio colocar a verificaзгo no onplayerupdate?, vai ficar verificando muitas vezes por segundo... й bem melhor verificar pela stock como o cara falou lб em cima, e checar quando ele upar, ou por a checagem no onplayerdeath como o Lуs falou.