a Problem !
#1

I have created a command /invite in dialog for the player who want's in the Organization...
When the player Accept in Dialog, he isn't a member and his skin isn't changing why ?
here is the dialog
pawn Код:
if(dialogid == 1122)
  {
      if(!response) return SendClientMessage(playerid, COLOR_WHITE,"{37F906}INFO:{FFFFFF}Ja Odbivte ponudata za Clenstvo!");
      {
      new para1;
      new ftext[20];
      switch(listitem)
      {
            case 1:
            {
                            if(PlayerInfo[playerid][pLeader] == 1) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "LS PD"; ChosenSkin[para1] = 265; SetPlayerSkin(para1, 265); }
                            else if(PlayerInfo[playerid][pLeader] == 2) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "FBI"; ChosenSkin[para1] = 286; SetPlayerSkin(para1, 286); }
                            else if(PlayerInfo[playerid][pLeader] == 4) { PlayerInfo[para1][pTeam] = 1; gTeam[para1] = 1; ftext = "Hitna Pomoc"; ChosenSkin[para1] = 274; SetPlayerSkin(para1, 274); }
                            else if(PlayerInfo[playerid][pLeader] == 5) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "The Russian Mafia"; ChosenSkin[para1] = 126; SetPlayerSkin(para1, 126); }
                            else if(PlayerInfo[playerid][pLeader] == 6) { PlayerInfo[para1][pTeam] = 6; gTeam[para1] = 6; ftext = "The Escobar Cartel"; ChosenSkin[para1] = 98; SetPlayerSkin(para1, 98); }
                            else if(PlayerInfo[playerid][pLeader] == 7) { PlayerInfo[para1][pTeam] = 7; gTeam[para1] = 7; ftext = "Vlada"; ChosenSkin[para1] = 61; SetPlayerSkin(para1, 61); }
                            else if(PlayerInfo[playerid][pLeader] == 9) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "[SE:RT] Novinari"; ChosenSkin[para1] = 17; SetPlayerSkin(para1, 17); }
                            else if(PlayerInfo[playerid][pLeader] == 10) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Taxi Company"; ChosenSkin[para1] = 182; SetPlayerSkin(para1, 182); }
                            else if(PlayerInfo[playerid][pLeader] == 12) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Parking Servis"; ChosenSkin[para1] = 8; SetPlayerSkin(para1, 8); }
                            else if(PlayerInfo[playerid][pLeader] == 15) { PlayerInfo[para1][pTeam] = 15; gTeam[para1] = 15; ftext = "Los Santos Vagos"; ChosenSkin[para1] = 108; SetPlayerSkin(para1, 108); }
                            else if(PlayerInfo[playerid][pLeader] == 16) { PlayerInfo[para1][pTeam] = 16; gTeam[para1] = 16; ftext = "Grove Street Family"; ChosenSkin[para1] = 106; SetPlayerSkin(para1, 106); }
                            else { return 1; }
                            //GetPlayerNameEx(para1, giveplayer, sizeof(giveplayer));
                            //GetPlayerName(playerid, sendername, sizeof(sendername));
                            PlayerInfo[para1][pMember] = PlayerInfo[playerid][pLeader];
                            PlayerInfo[para1][pRank] = 1;
                            format(string, sizeof(string), "[INFO] {FFFFFF}Pozvani ste u %s, pozvao vas je Lider %s", ftext, sendername);
                            SendClientMessage(para1, COLOR_LIGHTBLUE, string);
            }
      }
      }
  }
Reply
#2

I think you didn't understand params very well. playerid is one which is using dialog. You created new variable here
pawn Код:
new para1; //default value is 0
And then you use it down as which returns value 0. Explain more about script and we will fix it.
Reply
#3

Why para1? Why you didn't use playerid ? + you haven't defined string.

pawn Код:
if(dialogid == 1122)
{
    if(!response)   return SendClientMessage(playerid, COLOR_WHITE,"{37F906}INFO:{FFFFFF}Ja Odbivte ponudata za Clenstvo!");
    else
    {
        new ftext[20];
        switch(listitem)
        {
            case 1:
            {
                if(PlayerInfo[playerid][pLeader] == 1) { PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; ftext = "LS PD"; ChosenSkin[playerid] = 265; SetPlayerSkin(playerid, 265); }
                else if(PlayerInfo[playerid][pLeader] == 2) { PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; ftext = "FBI"; ChosenSkin[playerid] = 286; SetPlayerSkin(playerid, 286); }
                else if(PlayerInfo[playerid][pLeader] == 4) { PlayerInfo[playerid][pTeam] = 1; gTeam[playerid] = 1; ftext = "Hitna Pomoc"; ChosenSkin[playerid] = 274; SetPlayerSkin(playerid, 274); }
                else if(PlayerInfo[playerid][pLeader] == 5) { PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; ftext = "The Russian Mafia"; ChosenSkin[playerid] = 126; SetPlayerSkin(playerid, 126); }
                else if(PlayerInfo[playerid][pLeader] == 6) { PlayerInfo[playerid][pTeam] = 6; gTeam[playerid] = 6; ftext = "The Escobar Cartel"; ChosenSkin[playerid] = 98; SetPlayerSkin(playerid, 98); }
                else if(PlayerInfo[playerid][pLeader] == 7) { PlayerInfo[playerid][pTeam] = 7; gTeam[playerid] = 7; ftext = "Vlada"; ChosenSkin[playerid] = 61; SetPlayerSkin(playerid, 61); }
                else if(PlayerInfo[playerid][pLeader] == 9) { PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; ftext = "[SE:RT] Novinari"; ChosenSkin[playerid] = 17; SetPlayerSkin(playerid, 17); }
                else if(PlayerInfo[playerid][pLeader] == 10) { PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; ftext = "Taxi Company"; ChosenSkin[playerid] = 182; SetPlayerSkin(playerid, 182); }
                else if(PlayerInfo[playerid][pLeader] == 12) { PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; ftext = "Parking Servis"; ChosenSkin[playerid] = 8; SetPlayerSkin(playerid, 8); }
                else if(PlayerInfo[playerid][pLeader] == 15) { PlayerInfo[playerid][pTeam] = 15; gTeam[playerid] = 15; ftext = "Los Santos Vagos"; ChosenSkin[playerid] = 108; SetPlayerSkin(playerid, 108); }
                else if(PlayerInfo[playerid][pLeader] == 16) { PlayerInfo[playerid][pTeam] = 16; gTeam[playerid] = 16; ftext = "Grove Street Family"; ChosenSkin[playerid] = 106; SetPlayerSkin(playerid, 106); }
                else
                {
                    return 1;
                }
                //GetPlayerNameEx(playerid, giveplayer, sizeof(giveplayer));
                //GetPlayerName(playerid, sendername, sizeof(sendername));
               
                PlayerInfo[playerid][pMember] = PlayerInfo[playerid][pLeader];
                PlayerInfo[playerid][pRank] = 1;
               
                format(string, sizeof(string), "[INFO] {FFFFFF}Pozvani ste u %s, pozvao vas je Lider %s", ftext, sendername);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
            }
        }
    }
}
Reply
#4

Quote:
Originally Posted by s3rious
Посмотреть сообщение
Why para1? Why you didn't use playerid ? + you haven't defined string.

pawn Код:
if(dialogid == 1122)
{
    if(!response)   return SendClientMessage(playerid, COLOR_WHITE,"{37F906}INFO:{FFFFFF}Ja Odbivte ponudata za Clenstvo!");
    else
    {
        new ftext[20];
        switch(listitem)
        {
            case 1:
            {
                if(PlayerInfo[playerid][pLeader] == 1) { PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; ftext = "LS PD"; ChosenSkin[playerid] = 265; SetPlayerSkin(playerid, 265); }
                else if(PlayerInfo[playerid][pLeader] == 2) { PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; ftext = "FBI"; ChosenSkin[playerid] = 286; SetPlayerSkin(playerid, 286); }
                else if(PlayerInfo[playerid][pLeader] == 4) { PlayerInfo[playerid][pTeam] = 1; gTeam[playerid] = 1; ftext = "Hitna Pomoc"; ChosenSkin[playerid] = 274; SetPlayerSkin(playerid, 274); }
                else if(PlayerInfo[playerid][pLeader] == 5) { PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; ftext = "The Russian Mafia"; ChosenSkin[playerid] = 126; SetPlayerSkin(playerid, 126); }
                else if(PlayerInfo[playerid][pLeader] == 6) { PlayerInfo[playerid][pTeam] = 6; gTeam[playerid] = 6; ftext = "The Escobar Cartel"; ChosenSkin[playerid] = 98; SetPlayerSkin(playerid, 98); }
                else if(PlayerInfo[playerid][pLeader] == 7) { PlayerInfo[playerid][pTeam] = 7; gTeam[playerid] = 7; ftext = "Vlada"; ChosenSkin[playerid] = 61; SetPlayerSkin(playerid, 61); }
                else if(PlayerInfo[playerid][pLeader] == 9) { PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; ftext = "[SE:RT] Novinari"; ChosenSkin[playerid] = 17; SetPlayerSkin(playerid, 17); }
                else if(PlayerInfo[playerid][pLeader] == 10) { PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; ftext = "Taxi Company"; ChosenSkin[playerid] = 182; SetPlayerSkin(playerid, 182); }
                else if(PlayerInfo[playerid][pLeader] == 12) { PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; ftext = "Parking Servis"; ChosenSkin[playerid] = 8; SetPlayerSkin(playerid, 8); }
                else if(PlayerInfo[playerid][pLeader] == 15) { PlayerInfo[playerid][pTeam] = 15; gTeam[playerid] = 15; ftext = "Los Santos Vagos"; ChosenSkin[playerid] = 108; SetPlayerSkin(playerid, 108); }
                else if(PlayerInfo[playerid][pLeader] == 16) { PlayerInfo[playerid][pTeam] = 16; gTeam[playerid] = 16; ftext = "Grove Street Family"; ChosenSkin[playerid] = 106; SetPlayerSkin(playerid, 106); }
                else
                {
                    return 1;
                }
                //GetPlayerNameEx(playerid, giveplayer, sizeof(giveplayer));
                //GetPlayerName(playerid, sendername, sizeof(sendername));
               
                PlayerInfo[playerid][pMember] = PlayerInfo[playerid][pLeader];
                PlayerInfo[playerid][pRank] = 1;
               
                format(string, sizeof(string), "[INFO] {FFFFFF}Pozvani ste u %s, pozvao vas je Lider %s", ftext, sendername);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
            }
        }
    }
}
If you had any sence and read this code you'd relise that he's trying to set it for another player from his player ID to another, Although we cant help him until he shows us where he's getting his other player ID from.
Reply
#5

oh, yes yes. You right! Sorry So he must had any other variable which store chosen player id. Right?


You should to use some method which save chosen player ID to some global variable and then handle with this dialog
Reply
#6

Isn't Working..:S
Reply
#7

Bump !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)