Errors on Invite command
#1

So I made an invite command for my faction system but I don't know how to fix the errors also how do I make so the user has to accept the invite?

/invite command
PHP код:
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,pnamesizeof(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;
    }

Errors:
Quote:

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.

Reply


Messages In This Thread
Errors on Invite command - by lramos15 - 12.10.2013, 15:40
Re: Errors on Invite command - by PT - 12.10.2013, 15:48
Re: Errors on Invite command - by Konstantinos - 12.10.2013, 15:58
Re: Errors on Invite command - by lramos15 - 12.10.2013, 16:27
Re: Errors on Invite command - by xVIP3Rx - 12.10.2013, 16:29
Re: Errors on Invite command - by Konstantinos - 12.10.2013, 16:36
Re: Errors on Invite command - by lramos15 - 12.10.2013, 16:52
Re: Errors on Invite command - by Konstantinos - 12.10.2013, 16:55
Re: Errors on Invite command - by lramos15 - 12.10.2013, 17:01

Forum Jump:


Users browsing this thread: 1 Guest(s)