My /invite cmd..
#1

PHP код:
CMD:invite(playerid,params[])
{
    new 
string[128],id,sendername[MAX_PLAYER_NAME];
    if(
PlayerInfo[playerid][pGroup] <= 0) return SendClientMessage(playerid,COLOR_GRAY,"You're not part of a group!");
    else if(
sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_GRAY,"Syntax: /invite [id]");
    else if(
id==INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_GRAY,"Error: Player is not connected!");
    else
    {
        
PlayerInfo[playerid][pGroup] = id;
        
PlayerInfo[playerid][pRank] = 1;
        
GetPlayerName(playeridsendernamesizeof(sendername));
        if(
PlayerInfo[playerid][pGroup] == 1) return PlayerInfo[id][pGroup] == 1;
        else if(
PlayerInfo[playerid][pGroup] == 2) return PlayerInfo[id][pGroup] == 2;
        else if(
PlayerInfo[playerid][pGroup] == 3) return PlayerInfo[id][pGroup] == 3;
        else if(
PlayerInfo[playerid][pGroup] == 4) return PlayerInfo[id][pGroup] == 4;
        else if(
PlayerInfo[playerid][pGroup] == 5) return PlayerInfo[id][pGroup] == 5;
        else if(
PlayerInfo[playerid][pGroup] == 6) return PlayerInfo[id][pGroup] == 6;
        else if(
PlayerInfo[playerid][pGroup] == 7) return PlayerInfo[id][pGroup] == 7;
        else if(
PlayerInfo[playerid][pGroup] == 8) return PlayerInfo[id][pGroup] == 8;
        else if(
PlayerInfo[playerid][pGroup] == 9) return PlayerInfo[id][pGroup] == 9;
        else if(
PlayerInfo[playerid][pGroup] == 10) return PlayerInfo[id][pGroup] == 10;
        
format(string,sizeof(string),"[INVITE] %s has invited you to group %d",sendername,id);
        
SendClientMessage(id,COLOR_YELLOW,string);
    }
    return 
1;

When I invite some one it says to the person "[INVITE] You have been invited to group 0" Even if I set my group to 1.. And should this save it to there player file? I need to know how to fix it so they get invited to the group that they got invited to.
Reply


Messages In This Thread
My /invite cmd.. - by Azzeto - 28.10.2011, 18:29
Re: My /invite cmd.. - by [MWR]Blood - 28.10.2011, 19:05
Re: My /invite cmd.. - by FUNExtreme - 28.10.2011, 19:35

Forum Jump:


Users browsing this thread: 1 Guest(s)