Ajuda no Anti DM
#1

No OnPlayerDeath
eu coloquei:

pawn Код:
if(reason >= 0 && reason <= 46)
        {
            new kickname[MAX_PLAYER_NAME];
            new playername[MAX_PLAYER_NAME];
            new org=PlayerInfo[killerid][pMember];
            new org2=PlayerInfo[playerid][pMember];
            new nameorg;
            new nameorg2;
            if(org == 1){
                nameorg = SFPD;
            }else if(org == 2){
                nameorg = FBI;
            }else if(org == 3){
                nameorg = GN;
            }else if(org == 4){
                nameorg = Socorrista;
            }else if(org == 5){
                nameorg = Al'Qeada;
            }else if(org == 6){
                nameorg = Rifas;
            }else if(org == 7){
                nameorg = Prefeitura;
            }else if(org == 8){
                nameorg = Hitman;
            }else if(org == 9){
                nameorg = Reporter;
            }else if(org == 12){
                nameorg = Latin;
            }else if(org == 13){
                nameorg = Nang;
            }else if(org == 15){
                nameorg = Triads;
            }else{
                nameorg = Civil;
            }
            if(org2 == 1){
                nameorg2 = SFPD;
            }else if(org2 == 2){
                nameorg2 = FBI;
            }else if(org2 == 3){
                nameorg2 = GN;
            }else if(org2 == 4){
                nameorg2 = Socorrista;
            }else if(org2 == 5){
                nameorg2 = Al'
Qeada;
            }else if(org2 == 6){
                nameorg2 = Ballas;
            }else if(org2 == 7){
                nameorg2 = Prefeitura;
            }else if(org2 == 8){
                nameorg2 = Hitman;
            }else if(org2 == 9){
                nameorg2 = Reporter;
            }else if(org2 == 10){
                nameorg2 = Groove;
            }else if(org2 == 11){
                nameorg2 = Yakusa;
            }else if(org2 == 12){
                nameorg2 = Triads;
            }else{
                nameorg2 = Civil;
            }
            GetPlayerName(playerid,playername,sizeof(playername));
            GetPlayerName(killerid,kickname,sizeof(kickname));
            format(string,sizeof(string),"[%d]%s da ORG %s cometeu DM em [%d]%s da ORG %s. Verifique.",killerid,kickname,org,playerid,playername,org2);
            ABroadCast(COLOR_NANG, string, 1);
            return 1;
        }
sу que da esses erros:
Compilando CR.pwn...
C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(11940) : error 017: undefined symbol "SFPD"

C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(11942) : error 017: undefined symbol "FBI"
C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(11946) : error 017: undefined symbol "Socorrista"
C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(1194 : error 017: undefined symbol "Al"
C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(1194 : warning 215: expression has no effect
C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(1194 : error 001: expected token: ";", but found "-identifier-"
C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(1194 : error 017: undefined symbol "eada"
C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(1194 : fatal error 107: too many error messages on one line

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

7 Errors.

Alguem sabe como arrumo?
Reply
#2

pawn Код:
if(reason >= 0 && reason <= 46)
        {
            new kickname[MAX_PLAYER_NAME];
            new playername[MAX_PLAYER_NAME];
            new org=PlayerInfo[killerid][pMember];
            new org2=PlayerInfo[playerid][pMember];
            new nameorg;
            new nameorg2;
            if(org == 1){
                nameorg = SFPD;
            }else if(org == 2){
                nameorg = FBI;
            }else if(org == 3){
                nameorg = GN;
            }else if(org == 4){
                nameorg = Socorrista;
            }else if(org == 5){
                nameorg = AlQeada;
            }else if(org == 6){
                nameorg = Rifas;
            }else if(org == 7){
                nameorg = Prefeitura;
            }else if(org == 8){
                nameorg = Hitman;
            }else if(org == 9){
                nameorg = Reporter;
            }else if(org == 12){
                nameorg = Latin;
            }else if(org == 13){
                nameorg = Nang;
            }else if(org == 15){
                nameorg = Triads;
            }else{
                nameorg = Civil;
            }
            if(org2 == 1){
                nameorg2 = SFPD;
            }else if(org2 == 2){
                nameorg2 = FBI;
            }else if(org2 == 3){
                nameorg2 = GN;
            }else if(org2 == 4){
                nameorg2 = Socorrista;
            }else if(org2 == 5){
                nameorg2 = AlQeada;
            }else if(org2 == 6){
                nameorg2 = Ballas;
            }else if(org2 == 7){
                nameorg2 = Prefeitura;
            }else if(org2 == 8){
                nameorg2 = Hitman;
            }else if(org2 == 9){
                nameorg2 = Reporter;
            }else if(org2 == 10){
                nameorg2 = Groove;
            }else if(org2 == 11){
                nameorg2 = Yakusa;
            }else if(org2 == 12){
                nameorg2 = Triads;
            }else{
                nameorg2 = Civil;
            }
            GetPlayerName(playerid,playername,sizeof(playername));
            GetPlayerName(killerid,kickname,sizeof(kickname));
            format(string,sizeof(string),"[%d]%s da ORG %s cometeu DM em [%d]%s da ORG %s. Verifique.",killerid,kickname,org,playerid,playername,org2);
            ABroadCast(COLOR_NANG, string, 1);
            return 1;
        }
Manda o resto do erro tirei um pedaзo.
Reply
#3

Se vocк prestar atenзгo, algumas orgs nгo estгo definidas, tente definн-las ou retirб-las.
Reply
#4

Ygor naum й para definir as ORGs, sу quero q a variavel armazene o texto.

Code completo:

pawn Код:
if(killerid != 255)
    {
        if(reason >= 0 && reason <= 46)
        {
            new kickname[MAX_PLAYER_NAME];
            new playername[MAX_PLAYER_NAME];
            new org=PlayerInfo[killerid][pMember];
            new org2=PlayerInfo[playerid][pMember];
            new nameorg;
            new nameorg2;
            if(org == 1){
                nameorg = SFPD;
            }else if(org == 2){
                nameorg = FBI;
            }else if(org == 3){
                nameorg = GN;
            }else if(org == 4){
                nameorg = Socorrista;
            }else if(org == 5){
                nameorg = Al'Qeada;
            }else if(org == 6){
                nameorg = Rifas;
            }else if(org == 7){
                nameorg = Prefeitura;
            }else if(org == 8){
                nameorg = Hitman;
            }else if(org == 9){
                nameorg = Reporter;
            }else if(org == 12){
                nameorg = Latin;
            }else if(org == 13){
                nameorg = Nang;
            }else if(org == 15){
                nameorg = Triads;
            }else{
                nameorg = Civil;
            }
            if(org2 == 1){
                nameorg2 = SFPD;
            }else if(org2 == 2){
                nameorg2 = FBI;
            }else if(org2 == 3){
                nameorg2 = GN;
            }else if(org2 == 4){
                nameorg2 = Socorrista;
            }else if(org2 == 5){
                nameorg2 = Al'
Qeada;
            }else if(org2 == 6){
                nameorg2 = Rifas;
            }else if(org2 == 7){
                nameorg2 = Prefeitura;
            }else if(org2 == 8){
                nameorg2 = Hitman;
            }else if(org2 == 9){
                nameorg2 = Reporter;
            }else if(org2 == 12){
                nameorg2 = Latin;
            }else if(org2 == 13){
                nameorg2 = Nang;
            }else if(org2 == 15){
                nameorg2 = Triads;
            }else{
                nameorg2 = Civil;
            }
            GetPlayerName(playerid,playername,sizeof(playername));
            GetPlayerName(killerid,kickname,sizeof(kickname));
            format(string,sizeof(string),"[%d]%s da ORG %s cometeu DM em [%d]%s da ORG %s. Verifique.",killerid,kickname,org,playerid,playername,org2);
            ABroadCast(COLOR_NANG, string, 1);
            return 1;
        }
        else if(reason >=47 && reason <=54)
        {
            new kickname[MAX_PLAYER_NAME];
            new playername[MAX_PLAYER_NAME];
            GetPlayerName(playerid,playername,sizeof(playername));
            GetPlayerName(killerid,kickname,sizeof(kickname));
            format(string,sizeof(string),"[%d]%s cometeu DriveBy em [%d]%s. Verifique.",killerid,kickname,playerid,playername);
            ABroadCast(COLOR_NANG, string, 1);
            return 1;
        }
    }
Reply
#5

O problema й que quando se vai definir um nome a alguma variavel, dependendo do caso, deve-se colocar aspas e ponto e virgula. Entгo o codigo ficaria assim:

pawn Код:
if(reason >= 0 && reason <= 46)
        {
            new kickname[MAX_PLAYER_NAME];
            new playername[MAX_PLAYER_NAME];
            new org[20];        
            org=PlayerInfo[killerid][pMember];
            new org2[20];
            org2=PlayerInfo[playerid][pMember];
            new nameorg;
            new nameorg2;
            if(org == 1){
                nameorg = "SFPD";
            }else if(org == 2){
                nameorg = "FBI";
            }else if(org == 3){
                nameorg = "GN";
            }else if(org == 4){
                nameorg = "Socorrista";
            }else if(org == 5){
                nameorg = "Al'Qaeda";
            }else if(org == 6){
                nameorg = "Riffas";
            }else if(org == 7){
                nameorg = "Prefeitura";
            }else if(org == 8){
                nameorg = "Hitman";
            }else if(org == 9){
                nameorg = "Reporter";
            }else if(org == 12){
                nameorg = "Latin";
            }else if(org == 13){
                nameorg = "Nang";
            }else if(org == 15){
                nameorg = "Triads";
            }else{
                nameorg = "Civil";
            }
            if(org2 == 1){
                nameorg2 = "SFPD";
            }else if(org2 == 2){
                nameorg2 = "FBI";
            }else if(org2 == 3){
                nameorg2 = "GN";
            }else if(org2 == 4){
                nameorg2 = "Socorrista";
            }else if(org2 == 5){
                nameorg2 = "Al'Qaeda";
            }else if(org2 == 6){
                nameorg2 = "Ballas";
            }else if(org2 == 7){
                nameorg2 = "Prefeitura";
            }else if(org2 == 8){
                nameorg2 = "Hitman";
            }else if(org2 == 9){
                nameorg2 = "Reporter";
            }else if(org2 == 10){
                nameorg2 = "Groove";
            }else if(org2 == 11){
                nameorg2 = "Yakusa";
            }else if(org2 == 12){
                nameorg2 = "Triads";
            }else{
                nameorg2 = "Civil";
            }
            GetPlayerName(playerid,playername,sizeof(playername));
            GetPlayerName(killerid,kickname,sizeof(kickname));
            format(string,sizeof(string),"[%d] %s da ORG %s cometeu DM em [%d] %s da ORG %s. Verifique.",killerid,kickname,nameorg,playerid,playername,nameorg2);
            ABroadCast(COLOR_NANG, string, 1);
            return 1;
        }
OBS: Substitui essa linha aqui embaixo (1) pela outra de la de baixo (2), pois ja que vocк definiu um nome аs variaveis "nameorg" e "nameorg2" vocк deveria usб-las, o que nao estava ocorrendo. Confira:

pawn Код:
// (1) Troquei esta linha:
format(string,sizeof(string),"[%d] %s da ORG %s cometeu DM em [%d] %s da ORG %s. Verifique.",killerid,kickname,org,playerid,playername,org2);
pawn Код:
// (2) Por esta:
format(string,sizeof(string),"[%d] %s da ORG %s cometeu DM em [%d] %s da ORG %s. Verifique.",killerid,kickname,nameorg,playerid,playername,nameorg2);
@EDIT

O codigo jб esta modificado de acordo com a sugestгo do rjjj.
Reply
#6

O cуdigo que o Shadoww5 postou deve resolver o seu problema, mas antes de compilar, troque :


pawn Код:
new nameorg;
new nameorg2;

Por:


pawn Код:
new nameorg[20];
new nameorg2[20];

Pois apenas vetores/variбveis arrays podem ser igualados б texto (string).


Espero ter ajudado .
Reply
#7

Shadow com o seu cmd deu esses erros:

Compilando CR.pwn...
C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(11940) : error 006: must be assigned to an array

C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(11942) : error 006: must be assigned to an array
C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(11944) : error 006: must be assigned to an array

C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(11946) : error 006: must be assigned to an array
C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(1194 : error 006: must be assigned to an array

C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(11950) : error 006: must be assigned to an array
C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(11952) : error 006: must be assigned to an array
C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(11954) : error 006: must be assigned to an array

C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(11956) : error 006: must be assigned to an array
C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(1195 : error 006: must be assigned to an array
C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(11960) : error 006: must be assigned to an array

C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(11962) : error 006: must be assigned to an array
C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(11964) : error 006: must be assigned to an array
C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(11967) : error 006: must be assigned to an array
C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(11969) : error 006: must be assigned to an array

C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(11971) : error 006: must be assigned to an array
C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(11973) : error 006: must be assigned to an array
C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(11975) : error 006: must be assigned to an array
C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(11977) : error 006: must be assigned to an array

C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(11979) : error 006: must be assigned to an array
C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(11981) : error 006: must be assigned to an array
C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(11983) : error 006: must be assigned to an array

C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(11985) : error 006: must be assigned to an array
C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(11987) : error 006: must be assigned to an array
C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(11989) : error 006: must be assigned to an array
C:\Users\Deregudegu\Desktop\SAMP-SERVER\gamemodes\CR.pwn(11991) : error 006: must be assigned to an array

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


26 Errors.
Reply
#8

Ja corrigi o meu post .. Copie-o novamente e substitua pelo que vocк colocou no GM.
Reply
#9

Deu certo valeu pessoa, entгo quando eu for igualar uma variavel a um texto tenho q colocar aquele [] e dentro o tamanho?
Reply
#10

Quote:
Originally Posted by deregudegu
Посмотреть сообщение
Deu certo valeu pessoa, entгo quando eu for igualar uma variavel a um texto tenho q colocar aquele [] e dentro o tamanho?
Sim. E lembre-se das aspas e do ponto e virgula quando for fazer isto !

Se precisar, estamos aqui pra te ajudar. =D
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)