Problems
#1

pawn Код:
C:\Documents and Settings\Madalin\Desktop\freakz\gamemodes\FkZ.pwn(19435) : warning 225: unreachable code
C:\Documents and Settings\Madalin\Desktop\freakz\gamemodes\FkZ.pwn(19435) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Madalin\Desktop\freakz\gamemodes\FkZ.pwn(19439) : error 017: undefined symbol "pgun"
C:\Documents and Settings\Madalin\Desktop\freakz\gamemodes\FkZ.pwn(19439) : warning 215: expression has no effect
C:\Documents and Settings\Madalin\Desktop\freakz\gamemodes\FkZ.pwn(19439) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Madalin\Desktop\freakz\gamemodes\FkZ.pwn(19439) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Madalin\Desktop\freakz\gamemodes\FkZ.pwn(19439) : fatal error 107: too many error messages on one line

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


5 Errors.


pawn Код:
if(strcmp(cmdtext, "/armagratis", true) == 0)
{

        if(pgun[playerid] > 0) return SendClientMessage(playerid, -1, "You alredy used /armagratis");
        if(PlayerInfo[playerid][pDGun1] > 0)
        {
        SendClientMessage(playerid, COLOR_ORANGE,"Ai deja 3 arme!");
        return 1;
        }
        else
        {
        SendClientMessage(playerid, COLOR_BLUE, "   Foloseste /dgun pentru a primi armele infinite!");
        }
        if(pgun[playerid] == 0)
        {
        pgun[playerid] = 3;
        }
    return 1;
}


I do not know how to look for weapons to put my system in place pgun ...
Reply
#2

The thing is, you returned 1 after this:

pawn Код:
SendClientMessage(playerid, COLOR_ORANGE,"Ai deja 3 arme!");
return 1;
So the rest of the code isn't getting reached, you could also do:

pawn Код:
if(strcmp(cmdtext, "/armagratis", true) == 0)
{

        if(pgun[playerid] > 0) return SendClientMessage(playerid, -1, "You alredy used /armagratis");
        if(PlayerInfo[playerid][pDGun1] > 0) return  SendClientMessage(playerid, COLOR_ORANGE,"Ai deja 3 arme!");
        else
        {
            SendClientMessage(playerid, COLOR_BLUE, "   Foloseste /dgun pentru a primi armele infinite!");
        }
        if(pgun[playerid] == 0)
        {
            pgun[playerid] = 3;
        }
        return 1;
}
To make the code a bit cleaner.


EDIT: Apparently you also don't have pgun defined too, so do you have the new pgun[MAX_PLAYERS]; on top of your script?
Reply
#3

pawn Код:
if(strcmp(cmdtext, "/armagratis", true) == 0)
    {
        if(pgun[playerid] > 0) return SendClientMessage(playerid, -1, "You alredy used /armagratis");
       
        if(PlayerInfo[playerid][pDGun1] > 0) return SendClientMessage(playerid, COLOR_ORANGE,"Ai deja 3 arme!");
        else SendClientMessage(playerid, COLOR_BLUE, "   Foloseste /dgun pentru a primi armele infinite!");

        if(pgun[playerid] == 0) pgun[playerid] = 3;
    }
    return 1;
Quote:

error 017: undefined symbol "pgun"

That means you didn't define what pgun is, you should add a global/local variable or as you're trying to use it, like this
pawn Код:
new pgun[MAX_PLAYERS];
Reply
#4

pawn Код:
C:\Documents and Settings\Madalin\Desktop\freakz\gamemodes\FkZ.pwn(19430) : error 017: undefined symbol "pgun"
C:\Documents and Settings\Madalin\Desktop\freakz\gamemodes\FkZ.pwn(19430) : warning 215: expression has no effect
C:\Documents and Settings\Madalin\Desktop\freakz\gamemodes\FkZ.pwn(19430) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Madalin\Desktop\freakz\gamemodes\FkZ.pwn(19430) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Madalin\Desktop\freakz\gamemodes\FkZ.pwn(19430) : fatal error 107: too many error messages on one line

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


4 Errors.


pawn Код:
if(strcmp(cmd, "/dguns", true) == 0)
    {
        if(PlayerInfo[playerid][dPoints] > 0)
        {
            new gunname[32],slot1[32],slot2[32],slot3[32],slot4[32],slot5[32];
            if(PlayerInfo[playerid][dGun1] > 0)
            {
                if(PlayerInfo[playerid][dGun1] == 28) { format(gunname, sizeof(gunname), "Micro SMG"); }
                else if(PlayerInfo[playerid][dGun1] == 32) { format(gunname, sizeof(gunname), "Tec9"); }
                else { GetWeaponName(PlayerInfo[playerid][dGun1], gunname, sizeof(gunname)); }
                format(slot1, sizeof(slot1), "Slot 1 [%s]", gunname);
            }
            else { format(slot1, sizeof(slot1), "Slot 1 [Empty]"); }
            if(PlayerInfo[playerid][dGun2] > 0)
            {
                if(PlayerInfo[playerid][dGun2] == 28) { format(gunname, sizeof(gunname), "Micro SMG"); }
                else if(PlayerInfo[playerid][dGun2] == 32) { format(gunname, sizeof(gunname), "Tec9"); }
                else { GetWeaponName(PlayerInfo[playerid][dGun2], gunname, sizeof(gunname)); }
                format(slot2, sizeof(slot2), "Slot 2 [%s]", gunname);
            }
            else { format(slot2, sizeof(slot1), "Slot 2 [Empty]"); }
            if(PlayerInfo[playerid][dGun3] > 0)
            {
                if(PlayerInfo[playerid][dGun3] == 28) { format(gunname, sizeof(gunname), "Micro SMG"); }
                else if(PlayerInfo[playerid][dGun3] == 32) { format(gunname, sizeof(gunname), "Tec9"); }
                else { GetWeaponName(PlayerInfo[playerid][dGun3], gunname, sizeof(gunname)); }
                format(slot3, sizeof(slot3), "Slot 3 [%s]", gunname);
            }
            else { format(slot3, sizeof(slot1), "Slot 3 [Empty]"); }
            if(PlayerInfo[playerid][dGun4] > 0)
            {
                if(PlayerInfo[playerid][dGun4] == 28) { format(gunname, sizeof(gunname), "Micro SMG"); }
                else if(PlayerInfo[playerid][dGun4] == 32) { format(gunname, sizeof(gunname), "Tec9"); }
                else { GetWeaponName(PlayerInfo[playerid][dGun4], gunname, sizeof(gunname)); }
                format(slot4, sizeof(slot4), "Slot 4 [%s]", gunname);
            }
            else { format(slot4, sizeof(slot1), "Slot 4 [Empty]"); }
            if(PlayerInfo[playerid][dGun5] > 0)
            {
                if(PlayerInfo[playerid][dGun5] == 28) { format(gunname, sizeof(gunname), "Micro SMG"); }
                else if(PlayerInfo[playerid][dGun5] == 32) { format(gunname, sizeof(gunname), "Tec9"); }
                else { GetWeaponName(PlayerInfo[playerid][dGun5], gunname, sizeof(gunname)); }
                format(slot5, sizeof(slot5), "Slot 5 [%s]", gunname);
            }
            else { format(slot5, sizeof(slot1), "Slot 5 [Empty]"); }
            format(string, sizeof(string), "%s\n%s\n%s\n%s\n%s", slot1, slot2, slot3, slot4, slot5);
            ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_LIST,"Slot Select", string, "Select", "Cancel");
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "   You Have 0 Donate Points!");
        }
        return 1;
    }

That's according to weapons..
Reply
#5

"EDIT: Apparently you also don't have pgun defined too, so do you have the new pgun[MAX_PLAYERS]; on top of your script?"

Read my post again...
Reply
#6

pawn Код:
C:\Documents and Settings\Madalin\Desktop\freakz\gamemodes\FkZ.pwn(19432) : error 017: undefined symbol "pDGun1"
C:\Documents and Settings\Madalin\Desktop\freakz\gamemodes\FkZ.pwn(19438) : warning 225: unreachable code
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply
#7

Quote:
Originally Posted by madalin912
Посмотреть сообщение
pawn Код:
C:\Documents and Settings\Madalin\Desktop\freakz\gamemodes\FkZ.pwn(19432) : error 017: undefined symbol "pDGun1"
C:\Documents and Settings\Madalin\Desktop\freakz\gamemodes\FkZ.pwn(19438) : warning 225: unreachable code
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Do you even have the enum with pDgun?

Example of an enum:

pawn Код:
enum pInfo
{
    pDgun,
    pAnotherStat,
    pDifferentStat
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Reply
#8

dPoints,
dGun1,
dGun2,
dGun3,
dGun4,
dGun5,
pGun1,
pGun2,
pGun3,
pGun4,
Reply
#9

Then change the

pawn Код:
if(PlayerInfo[playerid][pDGun1] > 0)
to

pawn Код:
if(PlayerInfo[playerid][DGun1] > 0)
Reply
#10

When I get the game says 0 points...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)