[Ajuda] Sistema de salvar em letras e n numeros
#1

E ai, beleza? tenho um sistema aqui e estou fazendo um cmd, mais n esta funcionando por que?
PHP Code:
    if (strcmp(cmd"/admfuncao"true) == 0)
    {
            if (
AccountData[playerid][pAdmin] == 3000)
            {
                
tmp strtok(cmdtextidx);
                if (!
strlen(tmp)) return SendClientMessage(playerid, -1"USE: /admfuncao [ID/Nome] [Funзгo]");
                
giveplayerid ReturnUser(tmp);
                
                
tmp strtok(cmdtextidx);
                if (!
strlen(tmp)) return SendClientMessage(playerid, -1"USE: /admfuncao [ID/Nome] [Funзгo]");
                new 
funcao strval(tmp);
                
                if (
IsPlayerConnected(giveplayerid))
                {
                    if (
giveplayerid != INVALID_PLAYER_ID)
                    {
                       
AccountData[playerid][pFuncao] = funcao
                        
                    }
                }
            }
            else 
SendClientMessage(playeridCOLOR_GRAD1"ERRO: Vocк nгo tem nнvel administrativo suficiente.");
        return 
1;
    } 
Tipo, acima й para dar uma funзгo ae o id, mais o problema й que n consigo definir em letras a funзгo, pq carrega e salva por letras e esta criando por letras, e sim por nъmeros, o que faзo acima?

sistema:
PHP Code:
strmid(AccountData[playerid][pFuncao], "Administrar"0strlen("Administrar"), 255);
pFuncao[56
Reply
#2

up!!!!
Reply
#3

troque
PHP Code:
 AccountData[playerid][pFuncao] = funcao
por
PHP Code:
format(AccountData[playerid][pFuncao], 300funcao); 
Qualquer erro me avise
Reply
#4

Quote:
Originally Posted by garotin
View Post
troque
PHP Code:
 AccountData[playerid][pFuncao] = funcao
por
PHP Code:
format(AccountData[playerid][pFuncao], 300funcao); 
Qualquer erro me avise
E ai amigo, deu esses erros:

Code:
C:\Users\2\Desktop\Brasil United Life\gamemode\gamemodes\2.pwn(28773) : error 035: argument type mismatch (argument 3)
C:\Users\2\Desktop\Brasil United Life\gamemode\gamemodes\2.pwn(28767) : warning 204: symbol is assigned a value that is never used: "funcao"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
PHP Code:
    if (strcmp(cmd"/admfuncao"true) == 0)
    {
            if (
AccountData[playerid][pAdmin] == 3000)
            {
                
tmp strtok(cmdtextidx);
                if (!
strlen(tmp)) return SendClientMessage(playerid, -1"USE: /admfuncao [ID/Nome] [Funзгo]");
                
giveplayerid ReturnUser(tmp);
                
                
tmp strtok(cmdtextidx);
                if (!
strlen(tmp)) return SendClientMessage(playerid, -1"USE: /admfuncao [ID/Nome] [Funзгo]");
                new 
funcao strval(tmp); //error linha 28767
                
                
if (IsPlayerConnected(giveplayerid))
                {
                    if (
giveplayerid != INVALID_PLAYER_ID)
                    {
                         
format(AccountData[playerid][pFuncao], 300funcao); //error linha 28773
                    
}
                }
            }
            else 
SendClientMessage(playeridCOLOR_GRAD1"ERRO: Vocк nгo tem nнvel administrativo suficiente.");
        return 
1;
    } 
Reply
#5

pawn Code:
format(AccountData[playerid][pFuncao], 300, "%s",funcao);
Falto um argumento !
Reply
#6

Quote:
Originally Posted by mau.tito
View Post
pawn Code:
format(AccountData[playerid][pFuncao], 300, "%s",funcao);
Falto um argumento !
Vdd , programar de madrugada resulta em falta de atenзгo kkk

@Edit
Se precisar de alguma ajuda ou duvida pode chamar skype que fico online direto garotin1408
Reply
#7

Quote:
Originally Posted by garotin
View Post
Vdd , programar de madrugada resulta em falta de atenзгo kkk

@Edit
Se precisar de alguma ajuda ou duvida pode chamar skype que fico online direto garotin1408
Ok..

@edit

Como eu faзo para pegar apenas letras, pq o ( strval(tmp) ) tб pegando caracteres em formato de nъmeros:

PHP Code:
new funcao strval(tmp); 
Reply
#8

use isso
PHP Code:
 new funcao strrest(cmdtext,idx); 
qualquer erro me avise
Reply
#9

Quote:
Originally Posted by garotin
View Post
use isso
PHP Code:
 new funcao strrest(cmdtext,idx); 
qualquer erro me avise
Tб dando esse erro:
PHP Code:
C:\Users\2\Desktop\Brasil United Life\gamemode\gamemodes\2.pwn(28767) : error 017undefined symbol "strrest"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
1 Error

linha:
PHP Code:
 new funcao strrest(cmdtext,idx); 
Reply
#10

Testa esse cmd e me diz o que acontece
PHP Code:
if(strcmp(cmd"/admfuncao"true) == 0)
{
    if(
AccountData[playerid][pAdmin] == 3000)
    {
        new 
plidfuncao[128];
        
tmp strtok(cmdtextidx);
        if(!
strlen(tmp)) return SendClientMessage(playerid, -1"USE: /admfuncao [ID] [Funзгo]");
        
plid strval(tmp);
        
        
funcao strrest(cmdtextidx);
        if(!
strlen(funcao)) {
        
SendClientMessage(playerid, -1"USE: /admfuncao [ID] [Funзгo]");
        return 
1;
        }

        if(
IsPlayerConnected(plid))
        {
            if(
plid != INVALID_PLAYER_ID)
            {
                
format(AccountData[plid][pFuncao], 128"%s"funcao);
            }
        }
    }
    else 
SendClientMessage(playeridCOLOR_GRAD1"ERRO: Vocк nгo tem nнvel administrativo suficiente.");
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)