[ajuda]Porque nao ta setando ?
#1

Bom fiz um comando de dar admin (SOMENTE LOGADO NA RCON).

Mas se eu der /daradmin ID "LEVEL".
o Level й setado a 1.
Mesmo se eu escolher 4 5 2 :S

pawn Код:
CMD:daradmin(playerid, params[])
{
    new Str[175];
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"{8C8C8C}(ERROR) {FF1E00}Vocк Nгo й Admin");
    if(sscanf(params,"ii",Id,Level)) return SendClientMessage(playerid,-1,"{969696}(AVISO) {FF1E00}Use: daradmin [ID] [Level]");
    if(!IsPlayerConnected(Id)) return SendClientMessage(playerid,-1,"{8C8C8C}(ERROR) {FF1E00}Player Nгo Conectado");
    PlayerInfo[playerid][Admin] = Level;
    format(Str,175, "{969696}(AVISO) {00C3FF}O Adiministrador {FF9600}%s {00C3FF}Deu Admin de Level {FF9600}%d {00C3FF}Para o Player {FF9600}%s",Nome(playerid),Level,Nome(Id));
    SendClientMessageToAll(-1, Str);
    SalvarContas(playerid);
    return 1;
}
Reply
#2

pawn Код:
CMD:daradmin(playerid, params[])
{
    new Str[175];
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"{8C8C8C}(ERROR) {FF1E00}Vocк Nгo й Admin");
    if(sscanf(params,"ii",Id,Level)) return SendClientMessage(playerid,-1,"{969696}(AVISO) {FF1E00}Use: daradmin [ID] [Level]");
    if(!IsPlayerConnected(Id)) return SendClientMessage(playerid,-1,"{8C8C8C}(ERROR) {FF1E00}Player Nгo Conectado");
    PlayerInfo[Id][Admin] = Level;
    format(Str,175, "{969696}(AVISO) {00C3FF}O Adiministrador {FF9600}%s {00C3FF}Deu Admin de Level {FF9600}%d {00C3FF}Para o Player {FF9600}%s",Nome(playerid),Level,Nome(Id));
    SendClientMessageToAll(-1, Str);
    SalvarContas(Id);
    return 1;
}
Reply
#3

Quote:
Originally Posted by Gustavo_Araujo
Посмотреть сообщение
pawn Код:
CMD:daradmin(playerid, params[])
{
    new Str[175];
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"{8C8C8C}(ERROR) {FF1E00}Vocк Nгo й Admin");
    if(sscanf(params,"ii",Id,Level)) return SendClientMessage(playerid,-1,"{969696}(AVISO) {FF1E00}Use: daradmin [ID] [Level]");
    if(!IsPlayerConnected(Id)) return SendClientMessage(playerid,-1,"{8C8C8C}(ERROR) {FF1E00}Player Nгo Conectado");
    PlayerInfo[Id][Admin] = Level;
    format(Str,175, "{969696}(AVISO) {00C3FF}O Adiministrador {FF9600}%s {00C3FF}Deu Admin de Level {FF9600}%d {00C3FF}Para o Player {FF9600}%s",Nome(playerid),Level,Nome(Id));
    SendClientMessageToAll(-1, Str);
    SalvarContas(Id);
    return 1;
}
Ainda ta Setando a 1
Reply
#4

Ou vocк esta digitando o Comando errado/usando errado,ou seu sscanf bugou...Faz um debug.
Reply
#5

pawn Код:
CMD:daradmin(playerid, params[])
{
    new Str[175], ii, dd;
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"{8C8C8C}(ERROR) {FF1E00}Vocк Nгo й Admin");
    if(sscanf(params,"di", ii, dd)) return SendClientMessage(playerid,-1,"{969696}(AVISO) {FF1E00}Use: daradmin [ID] [Level]");
    if(!IsPlayerConnected(ii)) return SendClientMessage(playerid,-1,"{8C8C8C}(ERROR) {FF1E00}Player Nгo Conectado");
    PlayerInfo[ii][Admin] = dd;
    format(Str,175, "{969696}(AVISO) {00C3FF}O Adiministrador {FF9600}%s {00C3FF}Deu Admin de Level {FF9600}%d {00C3FF}Para o Player {FF9600}%s",Nome(playerid),dd,Nome(ii));
    SendClientMessageToAll(-1, Str);
    SalvarContas(ii);
    return 1;
}
Reply
#6

pawn Код:
CMD:daradmin(playerid, params[])
{
    new Str[175], uId, iLevel;
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"{8C8C8C}(ERROR) {FF1E00}Vocк Nгo й Admin");
    if(sscanf(params, "ui", uId, iLevel)) return SendClientMessage(playerid, -1, "{969696}(AVISO) {FF1E00}Use: daradmin [ID] [Level]");
    if(!IsPlayerConnected(uId)) return SendClientMessage(playerid, -1, "{8C8C8C}(ERROR) {FF1E00}Player Nгo Conectado");
    PlayerInfo[uId][Admin] = iLevel;
    format(Str, 175, "{969696}(AVISO) {00C3FF}O Adiministrador {FF9600}%s {00C3FF}Deu Admin de Level {FF9600}%d {00C3FF}Para o Player {FF9600}%s",Nome(playerid),iLevel,Nome(uId));
    SendClientMessageToAll(-1, Str);
    SalvarContas(uId);
    return 1;
}
Reply
#7

Quote:
Originally Posted by Ricop522
Посмотреть сообщение
pawn Код:
CMD:daradmin(playerid, params[])
{
    new Str[175], ii, dd;
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"{8C8C8C}(ERROR) {FF1E00}Vocк Nгo й Admin");
    if(sscanf(params,"di", ii, dd)) return SendClientMessage(playerid,-1,"{969696}(AVISO) {FF1E00}Use: daradmin [ID] [Level]");
    if(!IsPlayerConnected(ii)) return SendClientMessage(playerid,-1,"{8C8C8C}(ERROR) {FF1E00}Player Nгo Conectado");
    PlayerInfo[ii][Admin] = dd;
    format(Str,175, "{969696}(AVISO) {00C3FF}O Adiministrador {FF9600}%s {00C3FF}Deu Admin de Level {FF9600}%d {00C3FF}Para o Player {FF9600}%s",Nome(playerid),dd,Nome(ii));
    SendClientMessageToAll(-1, Str);
    SalvarContas(ii);
    return 1;
}
Funfo Valeu ae (:

Aproveitando o Post

Como que Eu faзo para Setar este textdraw em velocidade ?

pawn Код:
Textdraw11 = TextDrawCreate(294.000000, 349.000000, "~r~VeloAqui");
    TextDrawBackgroundColor(Textdraw11, 255);
    TextDrawFont(Textdraw11, 3);
    TextDrawLetterSize(Textdraw11, 0.490000, 1.000000);
    TextDrawColor(Textdraw11, -1);
    TextDrawSetOutline(Textdraw11, 1);
    TextDrawSetProportional(Textdraw11, 1);
No Lugar Do "VeloAqui" Setar a velocidade do carro.
Reply
#8

pawn Код:
new str[24], Float:fX, Float:fY, Float:fZ, Float:KMH;
for(new i = 0; i < MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i))
    {
        if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
        {
            GetPlayerPos(i, fX, fY, fZ);
            KMH = floatsqroot(floatpower(floatabs(floatsub(fX,fX[i])),2)+floatpower(floatabs(floatsub(fY,fY[i])),2)+floatpower(floatabs(floatsub(fZ,fZ[i])),2));
            KMH *= 4.5;
            format(str, sizeof(str), "~r~%0.0f", KMH);
            TextDrawSetString(Textdraw11, str);
        }
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)