/invite command
#1

hey, I'm working on an /invite command for faction leaders. I know how to invite them but I can't figure out how to set them to the faction I am inviting them from.
here is my code:
pawn Код:
COMMAND:invite(playerid, params[])
{
    if(PlayerInfo[playerid][pFactionRank] == 5)
    {
        new otherplayerid;
        if(sscanf(params, "u", otherplayerid)) // split input string and check level value 0 to 5
            SendClientMessage(playerid, 0xFFFFFFFF, "/invite [playerid/name]");
        else if(otherplayerid == INVALID_PLAYER_ID)
            SendClientMessage(playerid, 0xFFFFFFFF, "Player not connected");
        else
        {
            new string[72];
            format(string, sizeof(string), "Admin %s has invited you to factionID [%d]", GetPlayerNameEx(otherplayerid));
            SendClientMessage(otherplayerid, 0xFFFFFFFF,string);
            //What should I put here to set them in same faction as which I am inviting them from? PlayerInfo[playerid][pFaction] = PlayerInfo[otherplayerid][pFaction]; or what?
        }
    }
    else
    {
        SendClientMessage(playerid, 0xAAAAAAAA, "you aren't admin");
    }
    return 1;
}
Reply
#2

Код:
PlayerInfo[otherplayerid][pFaction] = PlayerInfo[playerid][pFaction];
Reply
#3

pawn Код:
format(string, sizeof(string), "Admin %s has invited you to factionID [%d]", GetPlayerNameEx(otherplayerid));
Learn scripting please.
Reply
#4

What you posted is wrong though. This is right:
Код:
format(string, sizeof(string), "Admin %s has invited you to factionID [%d]", GetPlayerNameEx(otherplayerid), factionid);
Edit: Lol, just noticed it was a typo by me. Obvious typo, stop being such an asshole.
Reply
#5

What typo? Do you know what a typo is?
Reply
#6

Typographical error (self-explaining). Lol, funny to see how you trying to be such a brainbox.
Reply
#7

Quote:
Originally Posted by maramizo
Посмотреть сообщение
pawn Код:
format(string, sizeof(string), "Admin %s has invited you to factionID [%d]", GetPlayerNameEx(otherplayerid));
Learn scripting please.
^Fail post.
Reply
#8

Quote:
Originally Posted by admantis
Посмотреть сообщение
Alright, but the word was still missing. Plus being bad in a specific languaje doesn't make you a bad scripter, does it ?
Ironic how you spelled language, isn't it.

Quote:
Originally Posted by xRyder
Посмотреть сообщение
^Fail post.
Huh?
Reply
#9

Quote:
Originally Posted by maramizo
Посмотреть сообщение
Huh?
I believe (s)he's referring to how you tried to correct the original person and then corrected it wrong.

If you have %s and %d inside of format, you need two specifiers at the end don't you? You only gave him one.
Reply
#10

Quote:
Originally Posted by randomkid88
Посмотреть сообщение
I believe (s)he's referring to how you tried to correct the original person and then corrected it wrong.

If you have %s and %d inside of format, you need two specifiers at the end don't you? You only gave him one.
I never corrected it, I just quoted his pawn and told him to learn scripting.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)