[TUT] Criando Gangs (/gang criar)
#21

isso e mais facil e n e complicado xD
Reply
#22

Eu fiz todo o tuto e deu 8 erros
pawn Code:
C:\Documents and Settings\Leandro novo\Desktop\Server novo\filterscripts\sgang.pwn(64) : error 017: undefined symbol "dini_Exists"
C:\Documents and Settings\Leandro novo\Desktop\Server novo\filterscripts\sgang.pwn(66) : error 017: undefined symbol "dini_Create"
C:\Documents and Settings\Leandro novo\Desktop\Server novo\filterscripts\sgang.pwn(67) : error 017: undefined symbol "dini_IntSet"
C:\Documents and Settings\Leandro novo\Desktop\Server novo\filterscripts\sgang.pwn(69) : warning 217: loose indentation
C:\Documents and Settings\Leandro novo\Desktop\Server novo\filterscripts\sgang.pwn(125) : error 017: undefined symbol "SendMessageToGang"
C:\Documents and Settings\Leandro novo\Desktop\Server novo\filterscripts\sgang.pwn(130) : warning 235: public function lacks forward declaration (symbol "OnPlayerPrivmsg")
C:\Documents and Settings\Leandro novo\Desktop\Server novo\filterscripts\sgang.pwn(141) : error 017: undefined symbol "PlayerInGang"
C:\Documents and Settings\Leandro novo\Desktop\Server novo\filterscripts\sgang.pwn(141) : warning 215: expression has no effect
C:\Documents and Settings\Leandro novo\Desktop\Server novo\filterscripts\sgang.pwn(141) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Leandro novo\Desktop\Server novo\filterscripts\sgang.pwn(141) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Leandro novo\Desktop\Server novo\filterscripts\sgang.pwn(141) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


8 Errors.
Esse e todo o fs, depois de ter feito todo o tutorial.
pawn Code:
#include <a_samp>

// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#if defined FILTERSCRIPT
#define MAX_GANGS 32
#define MAX_GANG_PLAYERS 16
#define SEM_GANG 0
new gangInvite[MAX_PLAYERS];
new PlayerInGang[MAX_PLAYERS];
new gangMembers[MAX_GANGS][MAX_GANG_PLAYERS];//Array para Enviar Mensagem posteriormente
new file[64];
format(file, sizeof(file), "%d.ini", GetPlayerTeam(playerid));// Salva Arquivo com ID_DA_GANG.ini
dini_Create(file);
dini_Set(file,"Nome",tmp);//Salvara Nome da Gang
stock ler_nome(gangid)
{
    new arquivo[128];
    format(arquivo,sizeof(arquivo),"%i.ini",gangid);
    format(arquivo,sizeof(arquivo),dini_Get(arquivo,"Nome"));
    return arquivo;
}

stock SendMessageToGang(playerid,color,const msg[])
{
   for (new i=0; i<MAX_GANG_PLAYERS; i++)//Pega os Membros da Gang
   {
   if (IsPlayerConnected(i) && PlayerInGang[playerid] > 0)//se tiver conectado e for de um gang
   {
   SendClientMessage(gangMembers[GetPlayerTeam(playerid)][i],color,msg);//Envia MSG para os mesmos da gang
   }
   }
   return 1;
}

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
if(!dini_Exists(Archivo))
{
dini_Create(Archivo);
dini_IntSet(Archivo, "GangsCreates", 0);
}
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    if(text[0] == '!') {//Se Tiver '!'
    new string[128]; GetPlayerName(playerid,string,sizeof(string));//Geta Nome
    format(string,sizeof(string),"Gang Chat: %s: %s",string,text[1]);//Formato da Mensagem
    SendMessageToGang(playerid,0xFFFFFFFF,string);//Envia Mensagem
    }
    return 0;
}

public OnPlayerPrivmsg(playerid, recieverid, text[])
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[128], idx;
cmd = comandos(cmdtext, idx);
if(strcmp(cmd, "/gangentrar", true) == 0)
  {
if(PlayerInGang[playerid]==0 && gangInvite[playerid] != 0) //Se o Convite for Diferente de '0' que seria a gang padrao  e  ele estiver fora da gang
{
SetPlayerTeam(playerid,gangInvite[playerid]); // coloca na gang como definido anteriormente
SendClientMessage(playerid, 0xFFFFFFFF, "vocк foi entrou na gang");
PlayerInGang[playerid] = GetPlayerTeam(playerid);
gangInvite[playerid] = 0;//Reseta o Convite
}
    return 1;
}
)//
if(strcmp(cmd, "/gangconvite", true) == 0)
    {
    new tmp[128];
    tmp = comandos(cmdtext, idx);
    if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "Uso do Comando: /gangconvite[ID]");
    SendClientMessage(playerid, 0xFFFFFFFF, "vocк foi convidado a entrar em uma gang");
    gangInvite[strval(tmp)] == PlayerInGang[playerid];//Habilita Convite para o ID da Gang
    return 1;
    }
    )//
if(strcmp(cmd, "/gangcriar", true) == 0)
    {
    new tmp[128];
        tmp = comandos(cmdtext, idx);
    if(PlayerInGang[playerid]>0)//Se o player estive em uma gang
    {
    return SendClientMessage(playerid, 0xFF8040FF, " Jб estбs em uma gang");;
    }
        new i;//define id da gang
    i= dini_Int("Gang.ini", "GangsCreates")+1;//define id da gang
    new string[128];
    format(string, sizeof(string),"Vocк criou a gang: '%s' (%d)", tmp, i);//Irб Enviar MSG que a gang foi criada com ID
    SendClientMessage(playerid, 0xFF8040FF, string);//Envia MSG
    PlayerInGang[playerid]=i;//Irб Colocar o Player na Gang
    SetPlayerTeam(playerid,PlayerInGang[playerid]);//Seta o Player a Uma Gang a Ativa Anti TK
    return 1;
    }


    return 0;
}

public OnPlayerInfoChange(playerid)
{
    return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
    return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
    return 1;
}

public OnRconCommand(cmd[])
{
    return 1;
}

public OnObjectMoved(objectid)
{
    return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
    return 1;
}

public OnPlayerExitedMenu(playerid)
{
    return 1;
}
public ler_nome(GetPlayerTeam(playerid));//Lк o nome da gang em arquivo

comandos(const string[], &index)//essa й a strtok modificada para nгo dar complicados com outras
{
    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;
}
Se puderem me ajudar ficarei grato.
Reply
#23

To comeзando gm do inicio ajuda ae
Quote:

C:\Users\Wilson\Desktop\Server GTA\gamemodes\grandlarc.pwn(337) : error 017: undefined symbol "comandos"
C:\Users\Wilson\Desktop\Server GTA\gamemodes\grandlarc.pwn(337) : error 033: array must be indexed (variable "cmd")
C:\Users\Wilson\Desktop\Server GTA\gamemodes\grandlarc.pwn(340) : error 017: undefined symbol "playerid"
C:\Users\Wilson\Desktop\Server GTA\gamemodes\grandlarc.pwn(342) : error 017: undefined symbol "playerid"
C:\Users\Wilson\Desktop\Server GTA\gamemodes\grandlarc.pwn(343) : error 017: undefined symbol "playerid"
C:\Users\Wilson\Desktop\Server GTA\gamemodes\grandlarc.pwn(344) : error 017: undefined symbol "playerid"
C:\Users\Wilson\Desktop\Server GTA\gamemodes\grandlarc.pwn(345) : error 017: undefined symbol "playerid"
C:\Users\Wilson\Desktop\Server GTA\gamemodes\grandlarc.pwn(347) : error 079: inconsistent return types (array & non-array)
C:\Users\Wilson\Desktop\Server GTA\gamemodes\grandlarc.pwn(352) : error 017: undefined symbol "comandos"
C:\Users\Wilson\Desktop\Server GTA\gamemodes\grandlarc.pwn(352) : error 033: array must be indexed (variable "tmp")
C:\Users\Wilson\Desktop\Server GTA\gamemodes\grandlarc.pwn(353) : error 017: undefined symbol "playerid"
C:\Users\Wilson\Desktop\Server GTA\gamemodes\grandlarc.pwn(353) : error 079: inconsistent return types (array & non-array)
C:\Users\Wilson\Desktop\Server GTA\gamemodes\grandlarc.pwn(354) : error 017: undefined symbol "playerid"
C:\Users\Wilson\Desktop\Server GTA\gamemodes\grandlarc.pwn(355) : error 017: undefined symbol "playerid"
C:\Users\Wilson\Desktop\Server GTA\gamemodes\grandlarc.pwn(356) : error 079: inconsistent return types (array & non-array)
C:\Users\Wilson\Desktop\Server GTA\gamemodes\grandlarc.pwn(361) : error 017: undefined symbol "comandos"
C:\Users\Wilson\Desktop\Server GTA\gamemodes\grandlarc.pwn(361) : error 033: array must be indexed (variable "tmp")
C:\Users\Wilson\Desktop\Server GTA\gamemodes\grandlarc.pwn(362) : error 017: undefined symbol "playerid"
C:\Users\Wilson\Desktop\Server GTA\gamemodes\grandlarc.pwn(364) : error 017: undefined symbol "playerid"
C:\Users\Wilson\Desktop\Server GTA\gamemodes\grandlarc.pwn(364) : error 079: inconsistent return types (array & non-array)
C:\Users\Wilson\Desktop\Server GTA\gamemodes\grandlarc.pwn(364) : warning 225: unreachable code
C:\Users\Wilson\Desktop\Server GTA\gamemodes\grandlarc.pwn(364) : error 036: empty statement
C:\Users\Wilson\Desktop\Server GTA\gamemodes\grandlarc.pwn(364) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


22 Errors.

Reply
#24

Drakins da erro af igual do lenadro arruma ae fazendo favor
Reply
#25

Tente atualizar a dini pra 0.3c
Reply
#26

e a 3.0c mesmo que to usando
Reply
#27

Atualize a include ~.~'
Reply
#28

man dexa ґ-ґ
Reply
#29

Quote:

Agora vamos ao comando em OnPlayerCommandTex:
GangEntrar:

Tudo para baixo й OnPlayerCommandText ? Pode explicar onde por esse resto?
Reply
#30

Parabкns уtimo sistema de Gang vou usar no meu RPG rs.
Reply
#31

Otimo Tutorial Drakins ..
Reply
#32

para resolver tudo:
pawn Code:
#include <dini>
Reply
#33

No cуdigo do final do GM й suposto ter um stock antes de "comandos"
Reply
#34

WTF?
Post saiu do Lanзamentos/Releases?
Reply
#35

Aff ¬¬ isso ta um Verdadeiro **** = Tuto Bruno parabens mt bem explicado quem nгo enteder e pq so usa o ctrl c +v mt bem manow parabens mesmo
Reply
#36

2 anos depois...
Reply
#37

уtimo tutorial, mas este tуpico nгo estб na бrea errada? =O
Reply
#38

olha a data nйh, na epoca axo que nгo.
Reply
#39

Sу os coveiros desenterrando topicos rs'
Reply
#40

Coveiros? Os cara tгo mais pra exйrcito de Hades lol'

¬¬
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)