[AJUDA] Codigo
#1

Ola Galera , + um Pobleminha , Rss .

Fui e acrensentei + 2 leveis de socio , pois sу eram 1 agora tem 3 leveis
mas sendo que o /darsocio , sу dar o socio 1 , queria que dar-se os outros 2

tipo /darsocio [id] [nivel de1 a 3]

Olha meu codigo ae .


Quote:

if(strcmp(cmd, "/darsocio", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [id]");
return 1;
}
new para1;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);

if (PlayerInfo[playerid][pAdmin] >= 1341)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pSocio] = 1;
format(string, sizeof(string), "Vocк ganhou VIP socio do admin %s", sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Vocк deu VIP socio para %s.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
new celulas[100], Nome[24];
if(!fexist("Socio.log")) return CriarLog("Socio.log");
GetPlayerName(playerid, Nome, 24);
format(celulas, sizeof(celulas), "%s deu sуcio para %d", Nome);
EscreverLog("Socio.log", celulas);
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo esta autorizado a usar este comando!");
}
}
return 1;
}

Й Isso Galera , sу falta ageitar isso pra Funfar 100%
Reply
#2

1234
Reply
#3

da proxima vez use o php

PHP код:
if(strcmp(cmd"/darsocio"true) == 0)
{
if(
IsPlayerConnected(playerid))
{
tmp strtok(cmdtextidx);
if(!
strlen(tmp))
{
SendClientMessage(playeridCOLOR_GRAD2"USE: /darsocio [id]");
return 
1;
}
new 
para1;
para1 ReturnUser(tmp);
tmp strtok(cmdtextidx);
if (
PlayerInfo[playerid][pAdmin] >= 1341)
{
if(
IsPlayerConnected(para1))
{
if(
para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1giveplayersizeof(giveplayer));
GetPlayerName(playeridsendernamesizeof(sendername));
PlayerInfo[para1][pSocio] = 1;
format(stringsizeof(string), "Vocк ganhou VIP socio do admin %s"sendername);
SendClientMessage(para1COLOR_LIGHTBLUEstring);
format(stringsizeof(string), "Vocк deu VIP socio para %s."giveplayer);
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
new 
celulas[100], Nome[24];
if(!
fexist("Socio.log")) return CriarLog("Socio.log");
GetPlayerName(playeridNome24);
format(celulassizeof(celulas), "%s deu sуcio para %d"Nome);
EscreverLog("Socio.log"celulas);
return 
1;
}
}
}
else
{
SendClientMessage(playeridCOLOR_GRAD1" Vocк nгo esta autorizado a usar este comando!");
}
}
return 
1;

Reply
#4

Quote:
Originally Posted by felipe_mr
Посмотреть сообщение
da proxima vez use o php

PHP код:
if(strcmp(cmd"/darsocio"true) == 0)
{
if(
IsPlayerConnected(playerid))
{
tmp strtok(cmdtextidx);
if(!
strlen(tmp))
{
SendClientMessage(playeridCOLOR_GRAD2"USE: /darsocio [id]");
return 
1;
}
new 
para1;
para1 ReturnUser(tmp);
tmp strtok(cmdtextidx);
if (
PlayerInfo[playerid][pAdmin] >= 1341)
{
if(
IsPlayerConnected(para1))
{
if(
para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1giveplayersizeof(giveplayer));
GetPlayerName(playeridsendernamesizeof(sendername));
PlayerInfo[para1][pSocio] = 1;
format(stringsizeof(string), "Vocк ganhou VIP socio do admin %s"sendername);
SendClientMessage(para1COLOR_LIGHTBLUEstring);
format(stringsizeof(string), "Vocк deu VIP socio para %s."giveplayer);
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
new 
celulas[100], Nome[24];
if(!
fexist("Socio.log")) return CriarLog("Socio.log");
GetPlayerName(playeridNome24);
format(celulassizeof(celulas), "%s deu sуcio para %d"Nome);
EscreverLog("Socio.log"celulas);
return 
1;
}
}
}
else
{
SendClientMessage(playeridCOLOR_GRAD1" Vocк nгo esta autorizado a usar este comando!");
}
}
return 
1;

Errado. Nгo й um cуdigo em PHP, й um cуdigo Pawn.
Reply
#5

tanto faz os 2 da certo eu acho esse mais legal
Reply
#6

Isto deve resolver o seu problema .


Apenas troque o seu comando por este :



pawn Код:
if(strcmp(cmd, "/darsocio", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))    return SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [id] [nivel de 1 a 3]");
        new para1 = ReturnUser(tmp);
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))    return SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [id] [nivel de 1 a 3]");
        if (PlayerInfo[playerid][pAdmin] >= 1341)
        {
            if(IsPlayerConnected(para1))
            {
                if(para1 != INVALID_PLAYER_ID)
                {
                    GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    new socio_nivel = strval(tmp);
                    PlayerInfo[para1][pSocio] = socio_nivel;
                    format(string, sizeof(string), "Vocк ganhou VIP socio nнvel %d do admin %s.", socio_nivel, sendername);
                    SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                    format(string, sizeof(string), "Vocк deu VIP socio nнvel %d para %s.", socio_nivel, giveplayer);
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    new celulas[100], Nome[24];
                    if(!fexist("Socio.log")) return CriarLog("Socio.log");
                    GetPlayerName(playerid, Nome, 24);
                    format(celulas, sizeof(celulas), "%s deu sуcio nнvel %d para %s.", Nome, socio_nivel, giveplayer);
                    EscreverLog("Socio.log", celulas);
                }
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo esta autorizado a usar este comando!");
        }
        return 1;
    }


Espero ter ajudado .
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)