14.10.2012, 08:41
pawn Код:
CMD:invite(playerid, params[])
{
new playerb, string[128];
if(!pData[playerid][pFacLeader]) return SendClientMessage(playerid, COLOR_GREY, "You are not a faction leader.");
if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /invite [playerid]");
if(!IsPlayerConnected(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
if(pData[playerb][pFac]) return SendClientMessage(playerid, COLOR_GREY, "Player is already in a faction.");
if(playerid == playerb) return SendClientMessage(playerid, COLOR_GREY, "You can't invite yourself.");
// Inviting
Invited[playerb] = 1;
Inviter[playerb] = playerid;
Faction[playerb] = pData[playerid][pFac];
format(string, sizeof(string), " You have invited %s to join the {33AA33}%s {33CCFF}faction.", playerb, playerid);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " %s has invited you to join the {33AA33}%s {33CCFF}faction. (/accept faction) (/cancel faction)", playerid, playerid);
SendClientMessage(playerb, COLOR_LIGHTBLUE, string);
return 1;
}
COMMAND:acceptfaction(playerid, params[])
{
new str[128];
if(pData[playerid][Invited] == 0) return SendClientMessage(playerid, GREY, "Nobody invited you to join a gang.");
pData[playerid][pFac] = pData[playerid][Invited];
pData[playerid][pFacRank] = 1;
pData[playerid][Invited] = 0;
format(str, sizeof(str), "%s has accepted to join %s, Welcome!", GetName(playerid), pData[playerid][pFac]);
[pData[playerid][pFac]][pMembers] += 1;
SaveAccount(playerid)
return 1;
}
pawn Код:
enum pinfo
{
Password[145],
IP[30],
LoggedIn,
Adminlevel,
Money,
Kills,
Level,
Deaths,
Warnings,
Jailed,
Muted,
Float:MyX,
Float:MyY,
Float:MyZ,
MyInterior,
Banned,
LPLevel,
Exp,
pFac,
pFacRank,
pFacLeader,
Invited,
Inviter,
pMembers,
};
F:\SA-MP\Server\gamemodes\w.pwn(1510) : warning 215: expression has no effect
F:\SA-MP\Server\gamemodes\w.pwn(1510) : error 001: expected token: ";", but found "]"
F:\SA-MP\Server\gamemodes\w.pwn(1510) : error 029: invalid expression, assumed zero
F:\SA-MP\Server\gamemodes\w.pwn(1510) : fatal error 107: too many error messages on one line
Can someone help me?

