/invite command - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /invite command (
/showthread.php?tid=230494)
/invite command -
Parrot - 23.02.2011
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;
}
Re: /invite command -
Hashski - 23.02.2011
Код:
PlayerInfo[otherplayerid][pFaction] = PlayerInfo[playerid][pFaction];
Re: /invite command -
maramizo - 23.02.2011
pawn Код:
format(string, sizeof(string), "Admin %s has invited you to factionID [%d]", GetPlayerNameEx(otherplayerid));
Learn scripting please.
Re: /invite command -
Parrot - 23.02.2011
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.
Re: /invite command -
maramizo - 23.02.2011
What typo? Do you know what a typo is?
Re: /invite command -
Parrot - 23.02.2011
Typographical error (self-explaining). Lol, funny to see how you trying to be such a brainbox.
Re: /invite command -
xRyder - 23.02.2011
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.
Re: /invite command -
maramizo - 23.02.2011
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?
Re: /invite command -
randomkid88 - 23.02.2011
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.
Re: /invite command -
maramizo - 23.02.2011
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.