[Ajuda] Sistema de Patente
#1

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

Reply
#2

PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    new 
str[50]; 
    if(
GetPlayerScore(killerid) >= 10
    { 
        
format(strsizeof(str), "~g~Patente: ~w~Novato"); 
        
TextDrawSetString(TextPatentestr); 
    } 
    if(
GetPlayerScore(killerid) >= 300
    { 
        
format(strsizeof(str), "~g~Patente: ~w~mediano"); 
        
TextDrawSetString(TextPatentestr); 
    } 
    if(
GetPlayerScore(killerid) >= 600
    { 
        
format(strsizeof(str), "~g~Patente: ~w~amador"); 
        
TextDrawSetString(TextPatentestr); 
    } 
    if(
GetPlayerScore(killerid) >= 1000
    { 
        
format(strsizeof(str), "~g~Patente: ~w~master"); 
        
TextDrawSetString(TextPatentestr); 
    } 
    return 
1;

Reply
#3

Quote:
Originally Posted by Lуs
Посмотреть сообщение
PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    new 
str[50]; 
    if(
GetPlayerScore(killerid) >= 10
    { 
        
format(strsizeof(str), "~g~Patente: ~w~Novato"); 
        
TextDrawSetString(TextPatentestr); 
    } 
    if(
GetPlayerScore(killerid) >= 300
    { 
        
format(strsizeof(str), "~g~Patente: ~w~mediano"); 
        
TextDrawSetString(TextPatentestr); 
    } 
    if(
GetPlayerScore(killerid) >= 600
    { 
        
format(strsizeof(str), "~g~Patente: ~w~amador"); 
        
TextDrawSetString(TextPatentestr); 
    } 
    if(
GetPlayerScore(killerid) >= 1000
    { 
        
format(strsizeof(str), "~g~Patente: ~w~master"); 
        
TextDrawSetString(TextPatentestr); 
    } 
    return 
1;

era so mudar la em cima?
Reply
#4

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
Reply
#5

Quote:
Originally Posted by Lуs
Посмотреть сообщение
PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    new 
str[50]; 
    if(
GetPlayerScore(killerid) >= 10
    { 
        
format(strsizeof(str), "~g~Patente: ~w~Novato"); 
        
TextDrawSetString(TextPatentestr); 
    } 
    if(
GetPlayerScore(killerid) >= 300
    { 
        
format(strsizeof(str), "~g~Patente: ~w~mediano"); 
        
TextDrawSetString(TextPatentestr); 
    } 
    if(
GetPlayerScore(killerid) >= 600
    { 
        
format(strsizeof(str), "~g~Patente: ~w~amador"); 
        
TextDrawSetString(TextPatentestr); 
    } 
    if(
GetPlayerScore(killerid) >= 1000
    { 
        
format(strsizeof(str), "~g~Patente: ~w~master"); 
        
TextDrawSetString(TextPatentestr); 
    } 
    return 
1;

quando eu coloco em public OnPlayerDeath , ae some o textdraw '-' , porque sera?
Reply
#6

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(playerid40.000000,322.000000,"Patente: "); //Crie sua textdraw
    
PlayerTextDrawAlignment(playeridTakelotP[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(playeridTakelotP[playerid],1);
    
PlayerTextDrawSetOutline(playeridTakelotP[playerid], 1);
    
PlayerTextDrawShowForPlayer(playeridTakelotP);
    return 
1;
}
public 
OnPlayerUpdate(playerid)
{
    new 
str[50];
    if(
GetPlayerScore(playerid) >= 10){
        
format(strsizeof(str), "~g~Patente: ~w~Novato");
        
PlayerTextDrawSetString(playerid,TakelotP[playerid], str);}
    if(
GetPlayerScore(playerid) >= 300){
        
format(strsizeof(str), "~g~Patente: ~w~mediano");
        
PlayerTextDrawSetString(playerid,TakelotP[playerid], str);}
    if(
GetPlayerScore(playerid) >= 600){
        
format(strsizeof(str), "~g~Patente: ~w~amador");
        
PlayerTextDrawSetString(playerid,TakelotP[playerid], str);}
    if(
GetPlayerScore(playerid) >= 1000){
        
format(strsizeof(str), "~g~Patente: ~w~master");
        
PlayerTextDrawSetString(playerid,TakelotP[playerid], str);}
    return 
1;

Reply
#7

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(playerid40.000000,322.000000,"Patente: "); //Crie sua textdraw
    
PlayerTextDrawAlignment(playeridTakelotP[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(playeridTakelotP[playerid],1);
    
PlayerTextDrawSetOutline(playeridTakelotP[playerid], 1);
    
PlayerTextDrawShowForPlayer(playeridTakelotP);
    return 
1;
}
public 
OnPlayerUpdate(playerid)
{
    new 
str[50];
    if(
GetPlayerScore(playerid) >= 10){
        
format(strsizeof(str), "~g~Patente: ~w~Novato");
        
PlayerTextDrawSetString(playerid,TakelotP[playerid], str);}
    if(
GetPlayerScore(playerid) >= 300){
        
format(strsizeof(str), "~g~Patente: ~w~mediano");
        
PlayerTextDrawSetString(playerid,TakelotP[playerid], str);}
    if(
GetPlayerScore(playerid) >= 600){
        
format(strsizeof(str), "~g~Patente: ~w~amador");
        
PlayerTextDrawSetString(playerid,TakelotP[playerid], str);}
    if(
GetPlayerScore(playerid) >= 1000){
        
format(strsizeof(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.
Reply
#8

sorry ^^, foi um erro de digitaзгo meu substitue a linha do erro por isso:

PHP код:
PlayerTextDrawShow(playeridPlayerText:TakelotP[playerid]); 
Reply
#9

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.
Reply
#10

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(playerid40.000000,322.000000,"Patente: "); //Crie sua textdraw
    
PlayerTextDrawAlignment(playeridTakelotP[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(playeridTakelotP[playerid],1);
    
PlayerTextDrawSetOutline(playeridTakelotP[playerid], 1);
    
PlayerTextDrawShowForPlayer(playeridTakelotP);
    return 
1;
}
public 
OnPlayerUpdate(playerid)
{
    new 
str[50];
    if(
GetPlayerScore(playerid) >= 10){
        
format(strsizeof(str), "~g~Patente: ~w~Novato");
        
PlayerTextDrawSetString(playerid,TakelotP[playerid], str);}
    if(
GetPlayerScore(playerid) >= 300){
        
format(strsizeof(str), "~g~Patente: ~w~mediano");
        
PlayerTextDrawSetString(playerid,TakelotP[playerid], str);}
    if(
GetPlayerScore(playerid) >= 600){
        
format(strsizeof(str), "~g~Patente: ~w~amador");
        
PlayerTextDrawSetString(playerid,TakelotP[playerid], str);}
    if(
GetPlayerScore(playerid) >= 1000){
        
format(strsizeof(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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)