Script errors + lines.
#1

array sizes do not match, or destination array is too small - That's the error I get when I compile.

Lines:

if(PlayerInfo[playerid][pLeader] == 1) {ftext = "Los Santos Police Department";}
else if(PlayerInfo[playerid][pLeader] == 2) {ftext = "Federal Bureau of Investigation";}
else if(PlayerInfo[playerid][pLeader] == 3) {ftext = "Department of Corrections";}
else if(PlayerInfo[playerid][pLeader] == 4) {ftext = "Los Santos Emergency Medical Services";}
else if(PlayerInfo[playerid][pLeader] == 5) {ftext = "U.S. Navy Seals";}
else if(PlayerInfo[playerid][pLeader] == 6) {ftext = "The Government";}
else if(PlayerInfo[playerid][pLeader] == 7) {ftext = "Secret Service";}
else if(PlayerInfo[playerid][pLeader] == {ftext = "Hitman Agency";}
else if(PlayerInfo[playerid][pLeader] == 9) {ftext = "San Andreas News Network";}
else if(PlayerInfo[playerid][pLeader] == 10) {ftext = "Taxi Cab Company";}
Reply
#2

Use This:
Код:
new ftext[20];
new pleader = PlayerInfo[playerid][pLeader];
new pmember = PlayerInfo[playerid][pMember];

if(pmember == 1 || pleader == 1) { ftext = "Los Santos Police Department"; }
I hope i helped you.
Reply
#3

Quote:

if(strcmp(cmd, "/invite", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /invite [playerid/PartOfName]");
return 1;
}
new ftext[20];
giveplayerid = ReturnUser(tmp);
if(PlayerInfo[playerid][pLeader] >= 1)
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[giveplayerid][pMember] == 0 && PlayerInfo[giveplayerid][pLeader] == 0 && PlayerInfo[giveplayerid][pFMember] == 255)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
if(PlayerInfo[playerid][pLeader] == 1) {ftext = "Los Santos Police Department";}
else if(PlayerInfo[playerid][pLeader] == 2) {ftext = "Federal Bureau of Investigation";}
else if(PlayerInfo[playerid][pLeader] == 3) {ftext = "Department of Corrections";}
else if(PlayerInfo[playerid][pLeader] == 4) {ftext = "Los Santos Emergency Medical Services";}
else if(PlayerInfo[playerid][pLeader] == 5) {ftext = "U.S. Navy Seals";}
else if(PlayerInfo[playerid][pLeader] == 6) {ftext = "The Government";}
else if(PlayerInfo[playerid][pLeader] == 7) {ftext = "Secret Service";}
else if(PlayerInfo[playerid][pLeader] == {ftext = "Hitman Agency";}
else if(PlayerInfo[playerid][pLeader] == 9) {ftext = "San Andreas News Network";}
else if(PlayerInfo[playerid][pLeader] == 10) {ftext = "Taxi Cab Company";}
format(string, sizeof(string), "You have invited %s to join %s.", giveplayer, ftext);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "%s has invited you to join %s. Type /accept faction to accept the invitation.",sendername, ftext);
SendClientMessage(giveplayerid, COLOR_YELLOW, string);
FactionOffer[giveplayerid] = playerid;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "The subjected player is already a member of an official faction.");
return 1;
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command (leaders only) !");
}
}
return 1;
}

^^That's the entire command. I don't really know where to place what you said, since it doesn't really fit in with the command itself. - I know this sounds nooby, but I'm fairly new to scripting, kind of.
Reply
#4

Los Santos Emergency Medical Services has 38 characters.

This way the correct would be:

PHP код:
new ftext[39
Reply
#5

EDIT: Shadoww5 were fasther so take his code and use it.
Reply
#6

Ok, I put in what you said, now my pawn compiler just crashes "/
Reply
#7

Add the new ftext[50]; to /invite cmd replace it with the new ftext[20];
Reply
#8

Now it's saying my pawn compiler library has stopped working, everytime I compile + run.
Reply
#9

Try:

PHP код:
if(strcmp(cmd"/invite"true) == 0)
{
    
tmp strtok(cmdtextidx);
    if(!
strlen(tmp)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /invite [playerid/PartOfName]");
    new 
ftext[20];
    
giveplayerid ReturnUser(tmp);
    if(
PlayerInfo[playerid][pLeader] < 1) return SendClientMessage(playeridCOLOR_GRAD1" You are not authorized to use that command (leaders only) !");
    if(
IsPlayerConnected(giveplayerid) && giveplayerid != INVALID_PLAYER_ID)
    {
        if(
PlayerInfo[giveplayerid][pMember] == && PlayerInfo[giveplayerid][pLeader] == && PlayerInfo[giveplayerid][pFMember] == 255)
        {
            
GetPlayerName(playeridsendernamesizeof(sendername));
            
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
            if(
PlayerInfo[playerid][pLeader] == 1) {ftext "Los Santos Police Department";}
            else if(
PlayerInfo[playerid][pLeader] == 2) {ftext "Federal Bureau of Investigation";}
            else if(
PlayerInfo[playerid][pLeader] == 3) {ftext "Department of Corrections";}
            else if(
PlayerInfo[playerid][pLeader] == 4) {ftext "Los Santos Emergency Medical Services";}
            else if(
PlayerInfo[playerid][pLeader] == 5) {ftext "U.S. Navy Seals";}
            else if(
PlayerInfo[playerid][pLeader] == 6) {ftext "The Government";}
            else if(
PlayerInfo[playerid][pLeader] == 7) {ftext "Secret Service";}
            else if(
PlayerInfo[playerid][pLeader] == {ftext "Hitman Agency";}
            else if(
PlayerInfo[playerid][pLeader] == 9) {ftext "San Andreas News Network";}
            else if(
PlayerInfo[playerid][pLeader] == 10) {ftext "Taxi Cab Company";}
            
format(stringsizeof(string), "You have invited %s to join %s."giveplayerftext);
            
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
            
format(stringsizeof(string), "%s has invited you to join %s. Type /accept faction to accept the invitation.",sendernameftext);
            
SendClientMessage(giveplayeridCOLOR_YELLOWstring);
            
FactionOffer[giveplayerid] = playerid;
        }
        else return 
SendClientMessage(playeridCOLOR_GREY"The subjected player is already a member of an official faction.");
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)