[Ajuda] Criaзao InfoAdmin
#1

Estou a desenvolver uma basic include porem esta dando erro , Eu nunca tentei fazer esse tipode sistema de InfoAdmin InfoOrg ...

Erros
pawn Код:
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(20) : error 017: undefined symbol "aVaga"
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(24) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(25) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(26) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(27) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(28) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(29) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(30) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(31) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(32) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(33) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(34) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(35) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(36) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(37) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(38) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(39) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(40) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(41) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(42) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(43) : error 033: array must be indexed (variable "DOF2_GetString")
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


21 Errors.
Code \/

PHP код:
#include a_samp
#include DOF2
#define LocaldeSalve                                    "ServerData/Admins/.ini"
#define MAX_ADM 10
#define SLOTS   100
enum aInfo{
   
VagaID[MAX_ADM]
}
new 
AdminInfo[SLOTS][aInfo];
new 
Admin,
        
Don[100],
               
DName[MAX_PLAYER_NAME];
stock CreateAdmin(id)
{
    if(
Admin >= MAX_ADM)return SendClientMessageToAll(-1,"[Aviso] Administraзao lotada!!!");
    
Admin++;
    
format(Donsizeof(Don), LocaldeSalveAdminInfo[id][aVaga]);
    if(!
DOF2_FileExists(Don))DOF2_CreateFile(Don);
    
DOF2_CreateFile(Don);
    
GetPlayerName(id,DName,sizeof(DName));
    if(
DOF2_GetString(Don"Vaga1") == DName) return AdminInfo[id][VagaID] = 1;
    if(
DOF2_GetString(Don"Vaga2") == DName) return AdminInfo[id][VagaID] = 2;
    if(
DOF2_GetString(Don"Vaga3") == DName) return AdminInfo[id][VagaID] = 3;
    if(
DOF2_GetString(Don"Vaga4") == DName) return AdminInfo[id][VagaID] = 4;
    if(
DOF2_GetString(Don"Vaga5") == DName) return AdminInfo[id][VagaID] = 5;
    if(
DOF2_GetString(Don"Vaga6") == DName) return AdminInfo[id][VagaID] = 6;
    if(
DOF2_GetString(Don"Vaga7") == DName) return AdminInfo[id][VagaID] = 7;
    if(
DOF2_GetString(Don"Vaga8") == DName) return AdminInfo[id][VagaID] = 8;
    if(
DOF2_GetString(Don"Vaga9") == DName) return AdminInfo[id][VagaID] = 9;
    if(
DOF2_GetString(Don"Vaga10") == DName) return AdminInfo[id][VagaID] = 10;
    if(
DOF2_GetString(Don"Vaga11") == DName) return AdminInfo[id][VagaID] = 11;
    if(
DOF2_GetString(Don"Vaga12") == DName) return AdminInfo[id][VagaID] = 12;
    if(
DOF2_GetString(Don"Vaga13") == DName) return AdminInfo[id][VagaID] = 13;
    if(
DOF2_GetString(Don"Vaga14") == DName) return AdminInfo[id][VagaID] = 14;
    if(
DOF2_GetString(Don"Vaga15") == DName) return AdminInfo[id][VagaID] = 15;
    if(
DOF2_GetString(Don"Vaga16") == DName) return AdminInfo[id][VagaID] = 16;
    if(
DOF2_GetString(Don"Vaga17") == DName) return AdminInfo[id][VagaID] = 17;
    if(
DOF2_GetString(Don"Vaga18") == DName) return AdminInfo[id][VagaID] = 18;
    if(
DOF2_GetString(Don"Vaga19") == DName) return AdminInfo[id][VagaID] = 19;
    if(
DOF2_GetString(Don"Vaga20") == DName) return AdminInfo[id][VagaID] = 20;
    return 
true;
}
stock DeleteAdmin(id)
{
    
format(Donsizeof(Don), LocaldeSalveAdminInfo[id][aVaga]);
    if(!
DOF2_FileExists(Don))
    {}
    else{
    }
    return 
true;

Alguem poderia me explicar o que ocorreu , como remover-lo !
Reply
#2

nao se pode comparar uma string caracteres

e uma integer numeros


o certo seria DOF2_GetInt
Reply
#3

Quote:
Originally Posted by Q.I
Посмотреть сообщение
nao se pode comparar uma string caracteres

e uma integer numeros


o certo seria DOF2_GetInt
Humm sabia nao....

@edit Consegui ....


@edit І
Como seria o Deletar admin?
Reply
#4

nao sei bem mais deve ser DOF2_RemoveFile <
Reply
#5

Quote:
Originally Posted by Q.I
Посмотреть сообщение
nao sei bem mais deve ser DOF2_RemoveFile <
Nao quero remover o arquivo apenas quero edita-lo para que seja ninguem.
Reply
#6

pawn Код:
GetPlayerName(id,DName,sizeof(DName));
if(DOF2_GetString(Don, "Vaga1") == DName)
Tem que continuar usando GetString, mas troque == por strcmp

format?
Reply
#7

Quote:
Originally Posted by Viniborn
Посмотреть сообщение
pawn Код:
GetPlayerName(id,DName,sizeof(DName));
if(DOF2_GetString(Don, "Vaga1") == DName)
Tem que continuar usando GetString, mas troque == por strcmp

format?

Certeza?

PHP код:
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(54) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(55) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(56) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(57) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(58) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(59) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(60) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(61) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(62) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(63) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(64) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(65) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(66) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(67) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(68) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(69) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(70) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(71) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(72) : error 033: array must be indexed (variable "DOF2_GetString")
C:\Documents and Settings\Maurilio\Desktop\SAMPSERVER\pawno\include\InfoAdmin.inc(73) : error 033: array must be indexed (variable "DOF2_GetString")
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
20 Errors

Reply
#8

Quote:
Originally Posted by Don_Speed
Посмотреть сообщение

Certeza?
Absoluta.

pawn Код:
GetPlayerName(id,DName,sizeof(DName));
if(DOF2_GetString(Don, "Vaga1") == DName)
Por este cуdigo supхe-se que no arquivo esteja escrito um nome, que й uma string assim como DName.
Portanto.

pawn Код:
GetPlayerName(id,DName,sizeof(DName));
if(!strcmp(DOF2_GetString(Don, "Vaga1"),DName))
Reply
#9

Quote:
Originally Posted by Viniborn
Посмотреть сообщение
Absoluta.

pawn Код:
GetPlayerName(id,DName,sizeof(DName));
if(DOF2_GetString(Don, "Vaga1") == DName)
Por este cуdigo supхe-se que no arquivo esteja escrito um nome, que й uma string assim como DName.
Portanto.

pawn Код:
GetPlayerName(id,DName,sizeof(DName));
if(!strcmp(DOF2_GetString(Don, "Vaga1"),DName))

Hum ja do um edit!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)