SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 27/10/2013, 04:39 AM   #11
Catchorro
Big Clucker
 
Catchorro's Avatar
 
Join Date: Oct 2013
Location: Pawn Copiler
Posts: 199
Reputation: 33
Default Re: Criar Um Comando /cv

Nusss
Quote:
C:\Documents and Settings\Lanterna Negra\Desktop\Projeto\gamemodes\Projeto.pwn(551) : warning 217: loose indentation
C:\Documents and Settings\Lanterna Negra\Desktop\Projeto\gamemodes\Projeto.pwn(555) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Lanterna Negra\Desktop\Projeto\gamemodes\Projeto.pwn(564) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Lanterna Negra\Desktop\Projeto\gamemodes\Projeto.pwn(59 : warning 217: loose indentation
C:\Documents and Settings\Lanterna Negra\Desktop\Projeto\gamemodes\Projeto.pwn(1135) : warning 217: loose indentation
C:\Documents and Settings\Lanterna Negra\Desktop\Projeto\gamemodes\Projeto.pwn(117 : error 021: symbol already defined: "strtok"
C:\Documents and Settings\Lanterna Negra\Desktop\Projeto\gamemodes\Projeto.pwn(1195) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Catchorro is offline   Reply With Quote
Old 27/10/2013, 04:42 AM   #12
BielCOP
Banned
 
Join Date: Nov 2012
Location: Estado de SP
Posts: 1,123
Reputation: -8
Default Re: Criar Um Comando /cv

Poste as linhas 551,555,564,590,1135,1170 e 1195.

Faça o seguinte também: Retire do fim do gm a strtok.
BielCOP is offline   Reply With Quote
Old 27/10/2013, 04:46 AM   #13
Catchorro
Big Clucker
 
Catchorro's Avatar
 
Join Date: Oct 2013
Location: Pawn Copiler
Posts: 199
Reputation: 33
Default Re: Criar Um Comando /cv

1 - retirei o negocio do fim do gm olhe oq deu
Quote:
C:\Documents and Settings\Lanterna Negra\Desktop\Projeto\gamemodes\Projeto.pwn(551) : warning 217: loose indentation
C:\Documents and Settings\Lanterna Negra\Desktop\Projeto\gamemodes\Projeto.pwn(554) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Lanterna Negra\Desktop\Projeto\gamemodes\Projeto.pwn(563) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Lanterna Negra\Desktop\Projeto\gamemodes\Projeto.pwn(597) : warning 217: loose indentation
C:\Documents and Settings\Lanterna Negra\Desktop\Projeto\gamemodes\Projeto.pwn(1134) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
La vai as linhas .....
554 ate a linha 563
Quote:
cmd = strtok(cmdtext,idx);

if(strcmp(cmd, "/cv", true) == 0)
{
if(VeiculoPlayer[playerid] >= 1)
{
SendClientMessage(playerid,0xBFBFBFAA,"Use /dcv.");
return 1;
}
tmp = strtok(cmdtext,idx);
Catchorro is offline   Reply With Quote
Old 27/10/2013, 04:51 AM   #14
BielCOP
Banned
 
Join Date: Nov 2012
Location: Estado de SP
Posts: 1,123
Reputation: -8
Default Re: Criar Um Comando /cv

Vamos concertar os warnings primeiro, poste as linhas 551, 597 e 1134.
BielCOP is offline   Reply With Quote
Old 27/10/2013, 04:56 AM   #15
Catchorro
Big Clucker
 
Catchorro's Avatar
 
Join Date: Oct 2013
Location: Pawn Copiler
Posts: 199
Reputation: 33
Default Re: Criar Um Comando /cv

Para poupar seu tempo eu mesmo tirei so falta os erros
Quote:
C:\Documents and Settings\Lanterna Negra\Desktop\Projeto\gamemodes\Projeto.pwn(554) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Lanterna Negra\Desktop\Projeto\gamemodes\Projeto.pwn(563) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Linhas :

Quote:
cmd = strtok(cmdtext,idx);

if(strcmp(cmd, "/cv", true) == 0)
{
if(VeiculoPlayer[playerid] >= 1)
{
SendClientMessage(playerid,0xBFBFBFAA,"Use /dcv.");
return 1;
}
tmp = strtok(cmdtext,idx);
Catchorro is offline   Reply With Quote
Old 27/10/2013, 05:00 AM   #16
BielCOP
Banned
 
Join Date: Nov 2012
Location: Estado de SP
Posts: 1,123
Reputation: -8
Default Re: Criar Um Comando /cv

Vá nas suas includes e veja se tem definido o strtok, caso tenha apague.

Depois coloque no final do gm:

pawn Code:
strtok(const string[], &index)
{
    new length = strlen(string);

    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }
 
    new offset = index;
    new result[20];

    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}
BielCOP is offline   Reply With Quote
Old 27/10/2013, 05:08 AM   #17
Catchorro
Big Clucker
 
Catchorro's Avatar
 
Join Date: Oct 2013
Location: Pawn Copiler
Posts: 199
Reputation: 33
Default Re: Criar Um Comando /cv

Unica coisa q eu achei foi algo parecido na minha dini kkkk
PHP Code:
/*
 *            Dini 1.5.1
 *       (c) Copyright 2006 by DracoBlue
 *
 * @author    : DracoBlue (http://dracoblue.com)
 * @date      : 13th May 2006
 * @update    : 3rd June 2007
 * @require   : DUtils 1.8
 *
 * This file is provided as is (no warranties).
 *
 * Feel free to use it, a little message in
 * about box is honouring thing, isn't it?
 *
 */

#if defined _dini_included
  #endinput
#endif

#define _dini_included
#pragma library dutils

#include <dutils>

stock  dini_Exists(filename[]) {
    if (
fexist(filename)) return true;
    return 
false;
}

stock  dini_Remove(filename[]) {
    if (!
fexist(filename)) return false;
    
fremove(filename);
    return 
true;
}

stock  dini_Create(filename[]) {
    new 
File:fhnd;
    if (
fexist(filename)) return false;
    
fhnd=fopen(filename,io_write);
    
fclose(fhnd);
    return 
true;
}

stock  dini_PRIVATE_ExtractKey(line[]) {
    new 
tmp[MAX_STRING];
    
tmp[0]=0;
    if (
strfind(line,"=",true)==-1) return tmp;
    
set(tmp,strlower(ret_memcpy(line,0,strfind(line,"=",true))));
    return 
tmp;
}

stock  dini_PRIVATE_ExtractValue(line[]) {
    new 
tmp[MAX_STRING];
    
tmp[0]=0;
    if (
strfind(line,"=",true)==-1) {
        return 
tmp;
    }
    
set(tmp,ret_memcpy(line,strfind(line,"=",true)+1,strlen(line)));
    return 
tmp;
}

stock  dini_Set(filename[],key[],value[]) {
    new 
File:fohndFile:fwhnd;
    new 
bool:wasset=false;
    new 
tmpres[MAX_STRING];
    if (
key[0]==0) return false/* If we have no sign in key, it can't be set*/
    
format(tmpres,sizeof(tmpres),"%s.part",filename);
    
fohnd=fopen(filename,io_read);
    if (!
fohnd) return false;
    
fremove(tmpres);
    
fwhnd=fopen(tmpres,io_write);
    
//  if (!fwhnd) return false;
    
while (fread(fohnd,tmpres)) {
        
StripNewLine(tmpres);
        if ((!
wasset)&&(equal(dini_PRIVATE_ExtractKey(tmpres),key,true))) {
            
/* We've got what needs to be replaced! */
            
format(tmpres,sizeof(tmpres),"%s=%s",key,value);
            
wasset=true;
        }
        
fwrite(fwhnd,tmpres);
        
fwrite(fwhnd,"\r\n");
    }

    if (!
wasset) {
        
format(tmpres,sizeof(tmpres),"%s=%s",key,value);
        
fwrite(fwhnd,tmpres);
        
fwrite(fwhnd,"\r\n");
    }

    
fclose(fohnd);
    
fclose(fwhnd);

    
format(tmpres,sizeof(tmpres),"%s.part",filename);
    if (
fcopytextfile(tmpres,filename)) {
        return 
fremove(tmpres);
    }
    return 
false;
}


stock  dini_IntSet(filename[],key[],value) {
   new 
valuestring[MAX_STRING];
   
format(valuestring,sizeof(valuestring),"%d",value);
   return 
dini_Set(filename,key,valuestring);
}

stock  dini_Int(filename[],key[]) {
   return 
strval(dini_Get(filename,key));
}

stock  dini_FloatSet(filename[],key[],Float:value) {
   new 
valuestring[MAX_STRING];
   
format(valuestring,sizeof(valuestring),"%f",value);
   return 
dini_Set(filename,key,valuestring);
}

stock  Float:dini_Float(filename[],key[]) {
   return 
floatstr(dini_Get(filename,key));
}

stock  dini_Bool(filename[],key[]) {
   return 
strval(dini_Get(filename,key));
}

stock  dini_BoolSet(filename[],key[],value) {
   new 
valuestring[MAX_STRING];
   
format(valuestring,sizeof(valuestring),"%d",value);
   return 
dini_Set(filename,key,valuestring);
}

stock  dini_Unset(filename[],key[]) {
    new 
File:fohndFile:fwhnd;
    new 
tmpres[MAX_STRING];
    
format(tmpres,sizeof(tmpres),"%s.part",filename);
    
fohnd=fopen(filename,io_read);
    if (!
fohnd) return false;
    
fremove(tmpres);
    
fwhnd=fopen(tmpres,io_write);
    
//  if (!fwhnd) return false;
    
while (fread(fohnd,tmpres)) {
        
StripNewLine(tmpres);
        if (
equal(dini_PRIVATE_ExtractKey(tmpres),key,true)) {
            
/* We've got what needs to be removed! */
        
} else {
            
format(tmpres,sizeof(tmpres),"%s",tmpres);
            
fwrite(fwhnd,tmpres);
            
fwrite(fwhnd,"\r\n");
        }
    }

    
fclose(fohnd);
    
fclose(fwhnd);

    
format(tmpres,sizeof(tmpres),"%s.part",filename);
    if (
fcopytextfile(tmpres,filename)) {
        return 
fremove(tmpres);
    }
    return 
false;
}

stock  dini_Get(filename[],key[]) {
    new 
File:fohnd;
    new 
tmpres[MAX_STRING];
    new 
tmpres2[MAX_STRING];
    
tmpres[0]=0;
    
fohnd=fopen(filename,io_read);
    if (!
fohnd) return tmpres;
    while (
fread(fohnd,tmpres)) {
        
StripNewLine(tmpres);
        if (
equal(dini_PRIVATE_ExtractKey(tmpres),key,true)) {
            
/* We've got what we need */
            
tmpres2[0]=0;
            
strcat(tmpres2,dini_PRIVATE_ExtractValue(tmpres));
            
fclose(fohnd);
            return 
tmpres2;
        }
    }
    
fclose(fohnd);
    return 
tmpres;
}


stock  dini_Isset(filename[],key[]) {
    new 
File:fohnd;
    new 
tmpres[MAX_STRING];
    
fohnd=fopen(filename,io_read);
    if (!
fohnd) return false;
    while (
fread(fohnd,tmpres)) {
        
StripNewLine(tmpres);
        if (
equal(dini_PRIVATE_ExtractKey(tmpres),key,true)) {
            
/* We've got what we need */
            
fclose(fohnd);
            return 
true;
        }
    }
    
fclose(fohnd);
    return 
false;

Catchorro is offline   Reply With Quote
Old 27/10/2013, 05:10 AM   #18
BielCOP
Banned
 
Join Date: Nov 2012
Location: Estado de SP
Posts: 1,123
Reputation: -8
Default Re: Criar Um Comando /cv

Troque a sua include Dini pela bCini e renomeie as funçoes.

http://forum.sa-mp.com/showthread.php?t=469974

Eu creio que fica mais fácil e mais veloz.
BielCOP is offline   Reply With Quote
Old 27/10/2013, 05:17 AM   #19
Catchorro
Big Clucker
 
Catchorro's Avatar
 
Join Date: Oct 2013
Location: Pawn Copiler
Posts: 199
Reputation: 33
Default Re: Criar Um Comando /cv

afi vei esquece pq deu varios erros aqui pts deixa pra la vou tenta acha outo codigo pq eu nao acho umas coisas na include sua qua leu troko olhe
Quote:
C:\Documents and Settings\Lanterna Negra\Desktop\Projeto\gamemodes\Projeto.pwn(225) : error 017: undefined symbol "dini_Isset"
C:\Documents and Settings\Lanterna Negra\Desktop\Projeto\gamemodes\Projeto.pwn(227) : error 017: undefined symbol "dini_Bool"
C:\Documents and Settings\Lanterna Negra\Desktop\Projeto\gamemodes\Projeto.pwn(229) : error 017: undefined symbol "dini_Bool"
C:\Documents and Settings\Lanterna Negra\Desktop\Projeto\gamemodes\Projeto.pwn(231) : error 017: undefined symbol "dini_Int"
C:\Documents and Settings\Lanterna Negra\Desktop\Projeto\gamemodes\Projeto.pwn(263) : error 017: undefined symbol "dini_BoolSet"
C:\Documents and Settings\Lanterna Negra\Desktop\Projeto\gamemodes\Projeto.pwn(265) : error 017: undefined symbol "dini_BoolSet"
C:\Documents and Settings\Lanterna Negra\Desktop\Projeto\gamemodes\Projeto.pwn(267) : error 017: undefined symbol "dini_IntSet"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


7 Errors.
Catchorro is offline   Reply With Quote
Old 27/10/2013, 05:28 AM   #20
BielCOP
Banned
 
Join Date: Nov 2012
Location: Estado de SP
Posts: 1,123
Reputation: -8
Default Re: Criar Um Comando /cv

dini_Isset para bCini_Setado
dini_Bool para bCini_GetarBool
dini_Int para bCini_GetarInt
dini_BoolSet para bCini_SetarBool
dini_IntSet para bCini_SetarInt
BielCOP is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Pedido] Podem criar o comando /aestacionar para mim? Não consigo criar tristtok Português/Portuguese 18 22/09/2013 06:36 PM
[Ajuda] Como criar o comando /rg DaviCOP Português/Portuguese 2 24/06/2013 06:40 PM
[Ajuda] Criar objeto com comando! SkullFire Português/Portuguese 9 05/05/2013 02:41 PM
[Ajuda] Ajuda Criar comando brunoboy Português/Portuguese 21 21/07/2012 11:34 AM
[DUV] criar um comando Lucas_Brasil Português/Portuguese 6 24/01/2010 07:04 PM


All times are GMT. The time now is 04:43 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.