View Single Post
Old 16/08/2009, 05:38 PM   #10
dice7
High-roller
 
Join Date: Apr 2009
Location: Slovenia
Posts: 2,200
Reputation: 22
Default Re: /set [sex] [male/female] Help please...

pawn Code:
dcmd_set(playerid,params[])
{
  new pName[MAX_PLAYER_NAME], File[256],thing[3],value[6]; /*thing has 3, because "sex" has 3 chars, value has 6 becase "female" has 6 chars, "male has 4*/
    GetPlayerName(playerid,pName,sizeof(pName));
  format(File,sizeof(File),"CLRP/Players/%s.ini",pName);

  if(sscanf(params,"ss",thing,value)) return SendClientMessage(playerid,COLOR_GREY,".: Usage: /set [sex] [male/female] :.");

  if(!strcmp(thing, "sex")) return SendClientMessage(playerid,COLOR_GREY,".: Usage: /set [sex]

      if(!strcmp(value, "
male"))
      {
          dini_IntSet(File,"
Sex",1);
          PlayerInfo[playerid][pSex] = 1;
            SendClientMessage(playerid,COLOR_GREENLIGHT,"
.: Info: Gender set to Male :.");
      }

      else if(!strcmp(value, "
female")
      {
          dini_IntSet(File,"
Sex",2);
          PlayerInfo[playerid][pSex] = 2;
            SendClientMessage(playerid,COLOR_GREENLIGHT,"
.: Info: Gender set to Female :.");
      }
      else SendClientMessage(playerid,COLOR_GREY,"
.: Usage: /set [sex] [male/female] :.");

    return 1;
}

edited
dice7 is offline