#define MAX_MEMBERS 8
new
InSquad = 0, //Player is not in a squad, 1 means player is in a squad
SquadMembers[MAX_PLAYERS];
public OnPlayerDisconnect(playerid, reason)
{
InSquad = 0;
return 1;
}
CMD:squadinvite(playerid, params[])
{
new targetid, str[120],
name[MAX_PLAYER_NAME],
tname[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(targetid, tname, sizeof(name));
if(sscanf(params, "d", targetid))
{
SendClientMessage(playerid, Col_Grey, "USAGE: /squadinvite [playerid]");
}
else
{
if(IsPlayerConnected(targetid))
{
if(InSquad(targetid) == 0)
{
new squadmembers = SquadMembers[playerid]
if(squadmembers != MAX_MEMBERS)
{
format(str, sizeof(str), "You have successfully sent a squad invitation to %s.", tname);
ShowPlayerDialog(targetid, 99, DIALOG_STYLE_MSGBOX, "Squad Invitation", "%s has invited you to their squad", "Accept", "Deny");
SendClientMessage(playerid, Col_Green, str);
InSquad(targetid) = 1;
}
else
{
SendClientMessage(playerid, Col_Red, "ERROR: Maximum members reached.");
}
}
else
{
SendClientMessage(playerid, Col_Red, "ERROR: Player is already in a squad.");
}
}
else
{
SendClientMessage(playerid, Col_Red, "ERROR: INVALID ID");
}
}
return 1;
}
E:\SA-MP Server Scripts\[S]uper\gamemodes\[S]uper2.pwn(398) : error 012: invalid function call, not a valid address E:\SA-MP Server Scripts\[S]uper\gamemodes\[S]uper2.pwn(398) : warning 215: expression has no effect E:\SA-MP Server Scripts\[S]uper\gamemodes\[S]uper2.pwn(398) : error 001: expected token: ";", but found ")" E:\SA-MP Server Scripts\[S]uper\gamemodes\[S]uper2.pwn(398) : error 029: invalid expression, assumed zero E:\SA-MP Server Scripts\[S]uper\gamemodes\[S]uper2.pwn(398) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
if(InSquad(targetid) == 0) |