[Pedido] Aзгo do personagem
#1

Galera eu preciso de um sistema desses rpg, quando vocк roubar, conversa etc, por exemplo

Code:
Nick_Teste estб tentando roubar o banco
Isso ai, eu procurei em um gm rpg atualizado, mais й uma gambiarra, ai eu falei, pode que o code esteja desatualizado, e como nгo sei otimizar esses tipos de codigos, queria pedir para vcs um desses. Obrigado
Reply
#2

Nгo entendi muito bem, vocк quer algo assim?

PHP Code:
CMD:fazeralgo(playerid)
{
    new 
string[128];
    
format(stringsizeof(string), "{FF7403}[Anuncio] {FFFFFF}O Player {FF7403}%s {FFFFFF}Esta Fazendo algo!"PlayerName(playerid));
    
SendClientMessageToAll(-1string);
    return 
1;

stock PlayerName
PHP Code:
 stock PlayerName(playerid)
{
    new 
aname[24];
    
GetPlayerName(playeridaname24);
    return 
aname;

Reply
#3

Quote:
Originally Posted by ScripitrFaunu
View Post
Nгo entendi muito bem, vocк quer algo assim?

PHP Code:
CMD:fazeralgo(playerid)
{
    new 
string[128];
    
format(stringsizeof(string), "{FF7403}[Anuncio] {FFFFFF}O Player {FF7403}%s {FFFFFF}Esta Fazendo algo!"PlayerName(playerid));
    
SendClientMessageToAll(-1string);
    return 
1;

stock PlayerName
PHP Code:
 stock PlayerName(playerid)
{
    new 
aname[24];
    
GetPlayerName(playeridaname24);
    return 
aname;

Nгo mano, vou mandar um exemplo:

PHP Code:
            new string[128];
            
format(stringsizeof(string), "*** %s %s"sendernameresult);
            
SendClientMessageInRange(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); 
Uma mensagem prуxima tlg?
Reply
#4

Tenta usar isso ai como base

PHP Code:
new string[128]; 
format(stringsizeof(string), "*** %s estб roubando a pqp"sendernameresult); 
for(new 
iMAX_PLAYERSi++)
{
    if(
IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i30.0x,y,z))
    {
        
SendClientMessage(playerid, -1string); 
    }

Reply
#5

Quote:
Originally Posted by IlanZ
View Post
Tenta usar isso ai como base

PHP Code:
new string[128]; 
format(stringsizeof(string), "*** %s estб roubando a pqp"sendernameresult); 
for(new 
iMAX_PLAYERSi++)
{
    if(
IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i30.0x,y,z))
    {
        
SendClientMessage(playerid, -1string); 
    }

Como posso criar uma stock com isso ai? pra nгo ter que ficar criando isso ai em todos os codes
Reply
#6

PHP Code:
stock(const string)
{
    
//new string[128];  
    
format(stringsizeof(string), "*** %s estб roubando a pqp"sendernameresult);  
    for(new 
iMAX_PLAYERSi++) 
    { 
        if(
IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i30.0x,y,z)) 
        { 
        
SendClientMessage(playerid, -1string);  
        } 
    }
  return 
true;

Era isso?

Vocк pode usar desse jeito, com getMaxPlayers a diferenзa do Max_Players que vocк percorre todo os slots do servidor, jб o getMaxPlayers ele puxa o maximo de jogadores conectado.

PHP Code:

stock
(const string)
{
    
//new string[128];  
    
format(stringsizeof(string), "*** %s estб roubando a pqp"sendernameresult);  
    for(new 
iGetMaxPlayers(); i++) 
    { 
        if(
IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i30.0x,y,z)) 
        { 
        
SendClientMessage(playerid, -1string);  
        } 
    } 
   return 
true;

Reply
#7

Quote:
Originally Posted by Maxwilson01
View Post
PHP Code:
stock(const string)
{
    
//new string[128];  
    
format(stringsizeof(string), "*** %s estб roubando a pqp"sendernameresult);  
    for(new 
iMAX_PLAYERSi++) 
    { 
        if(
IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i30.0x,y,z)) 
        { 
        
SendClientMessage(playerid, -1string);  
        } 
    }
  return 
true;

Era isso?

Vocк pode usar desse jeito, com getMaxPlayers a diferenзa do Max_Players que vocк percorre todo os slots do servidor, jб o getMaxPlayers ele puxa o maximo de jogadores conectado.

PHP Code:

stock
(const string)
{
    
//new string[128];  
    
format(stringsizeof(string), "*** %s estб roubando a pqp"sendernameresult);  
    for(new 
iGetMaxPlayers(); i++) 
    { 
        if(
IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i30.0x,y,z)) 
        { 
        
SendClientMessage(playerid, -1string);  
        } 
    } 
   return 
true;

GetMaxPlayer й mais lento que MAX_PLAYERS, uma boa opзгo й usar GetPlayerPoolSize.
Reply
#8

PHP Code:
stock SendClientMessageInRange(playerid,Float:raio,const string[]) 
{    
    new 
Float:X,Float:Y,Float:Z;
    
GetPlayerPos(playeridX,Y,Z);
    for(new 
iMAX_PLAYERS+1i++)  
    {  
        if(
IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i,raioX,Y,Z))  
        {  
            
SendClientMessage(i, -1string);   
        }  
    }  
   return 
true

/* 
    Modo de uso:
    SendClientMessageInRange(playerid, RAIO, STRING);
    Exemplo: 
    SendClientMessageInRange(playerid, 10.0, "Ele estб dando o cu kkk");
    
*/ 
Nгo testei.
Reply
#9

Quote:
Originally Posted by LucasF
View Post
GetMaxPlayer й mais lento que MAX_PLAYERS, uma boa opзгo й usar GetPlayerPoolSize.
Tendi, vou da uma estuda no GetPlayerPoolSize. hehe.
Reply
#10

Eu acho que entendi o cara ele quer dizer criar uma stock com mensagem preparadas que manda conforme o cara faz uma aзгo sem precisar ficar usando GETPLAYERNAME nos code ... mas eu n sei se й possivel...
Reply
#11

Lуgico que й, e й muito fбcil. Se ele quiser ele comenta dnv.
Reply
#12

Quote:
Originally Posted by IlanZ
View Post
PHP Code:
stock SendClientMessageInRange(playerid,Float:raio,const string[]) 
{    
    new 
Float:X,Float:Y,Float:Z;
    
GetPlayerPos(playeridX,Y,Z);
    for(new 
iMAX_PLAYERS+1i++)  
    {  
        if(
IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i,raioX,Y,Z))  
        {  
            
SendClientMessage(i, -1string);   
        }  
    }  
   return 
true

/* 
    Modo de uso:
    SendClientMessageInRange(playerid, RAIO, STRING);
    Exemplo: 
    SendClientMessageInRange(playerid, 10.0, "Ele estб dando o cu kkk");
    
*/ 
Nгo testei.
Vlw mano! Funcionou
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)