I need help command not working good
#1

Hello everybody I made this command but it's not working good.. What's not working are the messages because It doesn't show the string properly, it only shows 'INFO: ' but it doesn't show like 'INFO: %s has turned into a spy..', also when the spy mode is activated it doesnt say 'spy mode activated'
pawn Код:
if(strcmp("/spy",cmdtext,true)==0)
    {
        if (GetPlayerScore(playerid) < 480) return SendClientMessage(playerid,COLOR_RED,"ERROR: You need 7 hours (480 minutes) of gameplay to use this command!");
        if (Stealth[playerid] == 1) return SendClientMessage(playerid,COLOR_RED,"ERROR: You can't be a spy and have stealth mode activated!");
        if (IsSpy[playerid] == 0)
        {
            if (PlayerTeam[playerid] == TEAM_JAPFLEET)
            {
                for(new i = 0; i < MAX_PLAYERS; i ++)
                {
                    if (PlayerTeam[i] == PlayerTeam[playerid])
                    {
                        new string[128], name[28];
                        GetPlayerName(playerid, name, sizeof(name));
                        format(string,sizeof(string),"INFO: %s has turned into a spy and now he has the same color and skin of enemies, %s is still a team mate !");
                        SendClientMessage(i,COLOR_CYAN,string);
                    }
                }
                IsSpy[playerid] = 1;
                SetPlayerColor(playerid,TEAM_AIRFORCEC);
                SetPlayerSkin(playerid,285);
                return 1;
            }
            else
            {
                for(new i = 0; i < MAX_PLAYERS; i ++)
                {
                    if (PlayerTeam[i] == PlayerTeam[playerid])
                    {
                        new string[128], name[28];
                        GetPlayerName(playerid, name, sizeof(name));
                        format(string,sizeof(string),"INFO: %s has turned into a spy and now he has the same color and skin of enemies, %s is still a team mate !");
                        SendClientMessage(i,COLOR_CYAN,string);
                    }
                }
                IsSpy[playerid] = 1;
                SetPlayerColor(playerid,TEAM_JAPFLEETC);
                SetPlayerSkin(playerid,287);
                return 1;
            }
        }

        else if (IsSpy[playerid] == 1)
        {
            SendClientMessage(playerid,COLOR_CYAN,"INFO: Spy mode unactivated.");
            if (PlayerTeam[playerid] == TEAM_JAPFLEET)
            {
                for(new i = 0; i < MAX_PLAYERS; i ++)
                {
                    if (PlayerTeam[i] == PlayerTeam[playerid])
                    {
                        new string[128], name[28];
                        GetPlayerName(playerid, name, sizeof(name));
                        format(string,sizeof(string),"INFO: %s has diactivated the spy mode and now has the team color and skin !");
                        SendClientMessage(i,COLOR_CYAN,string);
                    }
                }
                SetPlayerSkin(playerid,287);
                SetPlayerColor(playerid,TEAM_JAPFLEETC);
                return 1;
            }
            else
            {
                for(new i = 0; i < MAX_PLAYERS; i ++)
                {
                    if (PlayerTeam[i] == PlayerTeam[playerid])
                    {
                        new string[128], name[28];
                        GetPlayerName(playerid, name, sizeof(name));
                        format(string,sizeof(string),"INFO: %s has diactivated the spy mode and now has the team color and skin !");
                        SendClientMessage(i,COLOR_CYAN,string);
                    }
                }
                SetPlayerSkin(playerid,285);
                SetPlayerColor(playerid,TEAM_AIRFORCEC);
                return 1;
            }
        }
    }
Thank you if you fix it..
Reply
#2

Код:
format(string,sizeof(string),"INFO: %s has turned into a spy and now he has the same color and skin of enemies, %s is still a team mate !", ?????, ?????);
Reply
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
Код:
format(string,sizeof(string),"INFO: %s has turned into a spy and now he has the same color and skin of enemies, %s is still a team mate !", ?????, ?????);
Wow.. I'm so stupid.. I'll test it now
Reply
#4

Not working, I have the same bug. It doesn't show when spymode is activated nor the string, only 'INFO: '
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)