CMD:invite(playerid,params[])
{
new factionid,rank,pname[MAX_PLAYER_NAME],factionstring[256],inviterid;
PlayerInfo[playerid][Rank] = rank;
PlayerInfo[playerid][Faction] = factionid;
if(sscanf(params,"u",inviterid)) return SendClientMessage(playerid,COLOR_RED, "Usage: /invite [PlayerID/Name]");
if(PlayerInfo[inviterid][Faction] != 0) return SendClientMessage(playerid,COLOR_RED, "That player is already in a faction!");
if(PlayerInfo[playerid][Rank] = 10) {
GetPlayerName(playerid,pname, sizeof(pname));
PlayerInfo[inviterid][Rank] = 1;
PlayerInfo[inviterid][Faction] = factionid;
format(factionstring,256,"FACTION: %s% %s has invited you to %s%",FactionInfo[factionid][Rank10],pname,FactionInfo[factionid][fname]);
SendClientMessage(inviterid,COLOR_RED,factionstring);
}else {
SendClientMessage(playerid,COLOR_RED,"You are not a leader of a faction!");
return 1;
}
}
C:\Users\logan_000\Desktop\SAMP Server\gamemodes\lramos15.pwn(2024) : warning 219: local variable "factionid" shadows a variable at a preceding level C:\Users\logan_000\Desktop\SAMP Server\gamemodes\lramos15.pwn(2029) : warning 211: possibly unintended assignment C:\Users\logan_000\Desktop\SAMP Server\gamemodes\lramos15.pwn(2033) : error 032: array index out of bounds (variable "FactionInfo") C:\Users\logan_000\Desktop\SAMP Server\gamemodes\lramos15.pwn(2024) : warning 203: symbol is never used: "factionid" C:\Users\logan_000\Desktop\SAMP Server\gamemodes\lramos15.pwn(2024 -- 2039) : warning 209: function "cmd_invite" should return a value Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error. |
CMD:invite(playerid,params[])
{
new factionid, pname[MAX_PLAYER_NAME], factionstring[256], inviterid;
PlayerInfo[playerid][Faction] = factionid;
if(sscanf(params,"u",inviterid)) return SendClientMessage(playerid,COLOR_RED, "Usage: /invite [PlayerID/Name]");
if(PlayerInfo[inviterid][Faction] != 0) return SendClientMessage(playerid,COLOR_RED, "That player is already in a faction!");
if(PlayerInfo[playerid][Rank] = 10)
{
GetPlayerName(playerid,pname, sizeof(pname));
PlayerInfo[inviterid][Rank] = 1;
PlayerInfo[inviterid][Faction] = factionid;
format(factionstring,256,"FACTION: %s% %s has invited you to %s%",FactionInfo[factionid][Rank10],pname,FactionInfo[factionid][fname]);
SendClientMessage(inviterid,COLOR_RED,factionstring);
}
else SendClientMessage(playerid,COLOR_RED,"You are not a leader of a faction!");
return 1;
}
CMD:invite(playerid,params[])
{
new inviterid;
if(sscanf(params,"u",inviterid)) return SendClientMessage(playerid,COLOR_RED, "Usage: /invite [PlayerID/Name]");
if(PlayerInfo[inviterid][Faction] != 0) return SendClientMessage(playerid,COLOR_RED, "That player is already in a faction!");
if(PlayerInfo[playerid][Rank] == 10)
{
new factionid,pname[MAX_PLAYER_NAME],factionstring[64];
factionid = PlayerInfo[playerid][Faction];
GetPlayerName(playerid,pname, sizeof(pname));
PlayerInfo[inviterid][Rank] = 1;
PlayerInfo[inviterid][Faction] = factionid;
format(factionstring,256,"FACTION: %s% %s has invited you to %s%",FactionInfo[factionid][Rank10],pname,FactionInfo[factionid][fname]);
SendClientMessage(inviterid,COLOR_RED,factionstring);
}
else SendClientMessage(playerid,COLOR_RED,"You are not a leader of a faction!");
return 1;
}
C:\Users\logan_000\Desktop\SAMP Server\gamemodes\lramos15.pwn(2047) : warning 219: local variable "factionid" shadows a variable at a preceding level C:\Users\logan_000\Desktop\SAMP Server\gamemodes\lramos15.pwn(204 : error 022: must be lvalue (non-constant) C:\Users\logan_000\Desktop\SAMP Server\gamemodes\lramos15.pwn(204 : warning 215: expression has no effect C:\Users\logan_000\Desktop\SAMP Server\gamemodes\lramos15.pwn(2052) : error 032: array index out of bounds (variable "FactionInfo") C:\Users\logan_000\Desktop\SAMP Server\gamemodes\lramos15.pwn(2047) : warning 203: symbol is never used: "factionid" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors. |
CMD:invite(playerid,params[])
{
new inviterid;
if(sscanf(params,"u",inviterid)) return SendClientMessage(playerid,COLOR_RED, "Usage: /invite [PlayerID/Name]");
if(PlayerInfo[inviterid][Faction] != 0) return SendClientMessage(playerid,COLOR_RED, "That player is already in a faction!");
if(PlayerInfo[playerid][Rank] == 10)
{
new _factionid,pname[MAX_PLAYER_NAME],factionstring[64];
_factionid = PlayerInfo[playerid][Faction];
GetPlayerName(playerid,pname, sizeof(pname));
PlayerInfo[inviterid][Rank] = 1;
PlayerInfo[inviterid][Faction] = _factionid;
format(factionstring,256,"FACTION: %s% %s has invited you to %s%",FactionInfo[_factionid][Rank10],pname,FactionInfo[_factionid][fname]);
SendClientMessage(inviterid,COLOR_RED,factionstring);
}
else SendClientMessage(playerid,COLOR_RED,"You are not a leader of a faction!");
return 1;
}