HELP.. "Friend" system..
#7

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[256],Friend[256];
    new idx;
  cmd = strtok(cmdtext, idx);
 
    if (strcmp("/addfriend", cmd, true, 10) == 0)
    {
   
    if(!strlen(tmp)) {
            SendClientMessage(playerid,0xAFAFAFFF,"Usage: /AddFriend (id)");
            return 1;
        }
        new id = strval(tmp);
        if(!IsPlayerConnected(id)) {
            SendClientMessage(playerid,0xAFAFAFFF,"/AddFriend : Bad player ID");
            return 1;
        }
        if(playerid == id) {
          SendClientMessage(playerid,0xAFAFAFFF,"You Cant be friends with yourself");
            return 1;
        }
        if(!dini_Exists(Friend)) {
            SendClientMessage(playerid,0xAFAFAFFF,"You Dont have a save file");
            return 1;
        }
        new NAME[MAX_PLAYER_NAME],FriendName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, NAME, sizeof(NAME));
        format(Friend, sizeof(Friend), "/FRIENDS/%s.txt", NAME);
      GetPlayerName(id, FriendName, sizeof(FriendName));
        dini_Set(Friend, "Friend1",     FriendName);
        return 1;
        }
    }
    return 0;
}
that should add a name to the file i think not tested though
Reply


Messages In This Thread
HELP.. "Friend" system.. - by Faith - 28.05.2010, 07:26
Re: HELP.. "Friend" system.. - by (SF)Noobanatior - 28.05.2010, 08:30
Re: HELP.. "Friend" system.. - by Faith - 28.05.2010, 10:04
Re: HELP.. "Friend" system.. - by Jay_ - 28.05.2010, 13:12
Re: HELP.. "Friend" system.. - by Faith - 28.05.2010, 16:17
Re: HELP.. "Friend" system.. - by Faith - 28.05.2010, 23:55
Re: HELP.. "Friend" system.. - by (SF)Noobanatior - 29.05.2010, 08:06
Re: HELP.. "Friend" system.. - by (SF)Noobanatior - 29.05.2010, 08:29
Re: HELP.. "Friend" system.. - by Faith - 29.05.2010, 09:45
Re: HELP.. "Friend" system.. - by (SF)Noobanatior - 29.05.2010, 20:51
Re: HELP.. "Friend" system.. - by Faith - 30.05.2010, 14:05
Re: HELP.. "Friend" system.. - by RedShirt - 30.05.2010, 14:36
Re: HELP.. "Friend" system.. - by azzerking - 30.05.2010, 14:52
Re: HELP.. "Friend" system.. - by iLinx - 30.05.2010, 15:01
Re: HELP.. "Friend" system.. - by azzerking - 30.05.2010, 15:12
Re: HELP.. "Friend" system.. - by Calgon - 30.05.2010, 15:20
Re: HELP.. "Friend" system.. - by Faith - 30.05.2010, 23:04
Re: HELP.. "Friend" system.. - by david_silva_111 - 06.08.2010, 23:20

Forum Jump:


Users browsing this thread: 5 Guest(s)