SA-MP Forums Archive
[Ajuda] OnPlayerText personalizada - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] OnPlayerText personalizada (/showthread.php?tid=494443)



OnPlayerText personalizada - eNtinityGaming - 13.02.2014

Tentei fazer pra quando o player for adm aparecer no chat [ adm ] tal tal. e quando o player nгo for adm aaparece sу o id:

pawn Код:
C:\Documents and Settings\Vini\Desktop\LSA v1.0\gamemodes\zumbi.pwn(3954) : warning 213: tag mismatch
C:\Documents and Settings\Vini\Desktop\LSA v1.0\gamemodes\zumbi.pwn(3954) : error 032: array index out of bounds (variable "pInfo")
C:\Documents and Settings\Vini\Desktop\LSA v1.0\gamemodes\zumbi.pwn(3961) : warning 213: tag mismatch
C:\Documents and Settings\Vini\Desktop\LSA v1.0\gamemodes\zumbi.pwn(3961) : error 032: array index out of bounds (variable "pInfo")
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.

pawn Код:
if (pInfo[playerid][Level] >= 1)
    {
        new string[256], pname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pname, sizeof(pname));
        format(string, sizeof(string), "[ %d ] [ ADM ] %s: %s", pname, playerid, text);
        SendClientMessageToAll(GetPlayerColor(playerid), string);
    }
    if (pInfo[playerid][Level] <= 0)
    {
        new string[256], pname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pname, sizeof(pname));
        format(string, sizeof(string), "[ %d ] %s: %s", pname, playerid, text);
        SendClientMessageToAll(GetPlayerColor(playerid), string);
    }



Re: OnPlayerText personalizada - lucas_mdr1235 - 13.02.2014

tenta assim possivelmente darб certo
PHP код:
    if (PlayerInfo[playerid][pLevel] >= 1)//Aki esta errado possivelmente voce deve usar esse tipo de variavel
    
{
        new 
string[128], pname[MAX_PLAYER_NAME];
        
GetPlayerName(playeridpnamesizeof(pname));
        
format(stringsizeof(string), "[ ID %d ] [ ADM ] %s: %s"playeridpnametext);//aki vocк inverteu os parametros de playerid e pname
        
SendClientMessageToAll(GetPlayerColor(playerid), string);
    }
    if (
PlayerInfo[playerid][pLevel] <= 0)//Aki tambem esta errado possivelmente voce deve usar esse tipo de variavel
    
{
        new 
string[128], pname[MAX_PLAYER_NAME];
        
GetPlayerName(playeridpnamesizeof(pname));
        
format(stringsizeof(string), "[ ID %d ] %s: %s"playeridpnametext);//aki vocк inverteu os parametros de playerid e pname
        
SendClientMessageToAll(GetPlayerColor(playerid), string);
    } 



Respuesta: OnPlayerText personalizada - eNtinityGaming - 13.02.2014

Vocк nгo entendeu, a variбvel estб certa.
PlayerInfo nгo й, meu gm usa pInfo, pLevel nгo й, meu gm usa Level!!!


Respuesta: OnPlayerText personalizada - eNtinityGaming - 13.02.2014

Aff era PInfo e nгo pInfo
obrigado ae, ja corrigi os erros!