Please Help me Again
#1

//----------------------------------[Gang Ballas e Vagos]-----------------------------------------------
if(strcmp(cmd, "/anunciogang", true) == 0 || strcmp(cmd, "/ang", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMembro] == 18, 19 || PlayerInfo[playerid][pLider] == 18, 19)
{
if(PlayerInfo[playerid][pCargo] < 4)
{
SendClientMessage(playerid, COLOR_GREY, "Voce precisa ter pelo menos cargo 4 para usar este comando!!");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /ang [texto]");
return 1;
}
SendClientMessageToAll(COLOR_WHITE, "||Anuncio de Gangs||");
format(string, sizeof(string), "Gangster %s: %s", sendername, result);
SendClientMessageToAll(0xFFFFFFFF, string);
}
}
return 1;
}

------------------------------------------------------------------------

This is my GM. I have a big problem now, i want to do the adds code for gangs. I want to put the code /ang for all the anounce gang messages but i cant do it. this is the error:

(
if(PlayerInfo[playerid][pMembro] == 18, 19 || PlayerInfo[playerid][pLider] == 18, 19))

How i put this for 2 or more gangs

Note: I try already copy this and change 1 to 18 and teh other to 19
Reply
#2

pawn Код:
if(PlayerInfo[playerid][pMembro] == 18, 19 || PlayerInfo[playerid][pLider] == 18, 19)
to
pawn Код:
new p = PlayerInfo[playerid][pMembro];
if(p == 18 || p == 19)
Reply
#3

try using :

pawn Код:
PlayerInfo[playerid][pMembro] == 18 && PlayerInfo[playerid][pMembro] == 19
//instead of:
PlayerInfo[playerid][pMembro] == 18 || PlayerInfo[playerid][pMembro] == 19
Reply
#4

The 2 solutions fail!

Error
Reply
#5

new membro;

pawn Код:
if (membro == 18 || membro == 19)
{
// does shit if membro is either 18 or 19
}
Reply
#6

Error!!!!!
Reply
#7

if(PlayerInfo[playerid][pMember] == 18 || PlayerInfo[playerid][pLeader] == 18 && PlayerInfo[playerid][pMember] == 19 || PlayerInfo[playerid][pLeader] == 19)
{
//CODE here
}

Try this
Reply
#8

ERROR!!!!
Reply
#9

Really? then show us the errors..
Reply
#10

pawn Код:
public FactionTest()
{
    IsHere(i)
    {
        if(PlayerInfo[i][Member] == 18 || PlayerInfo[i][Member] == 19)
        {
            if(PlayerInfo[i][Faction] == 18 || PlayerInfo[i][Faction] == 19)
            {
                SendClientMessage(i, COLOR_GREEN, "( ! ) you are either in a faction:18/19 or Member:18/19");
            }
        }
    }
}
Read and understand that simple little script and you will get your script working.

IsHere is just and macro version of
pawn Код:
for(new i=0; i<GetMaxPlayers(); i++)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)