View Single Post
Old 16/08/2009, 01:23 PM   #1
introzen
Gangsta
 
introzen's Avatar
 
Join Date: Aug 2008
Posts: 788
Reputation: 34
Default /set [sex] [male/female] Help please...

Hello everyone =)

I've tried to make a command witch sets the Sex for a person.

/set [sex] [male/female]

I will add more then /set sex soon... it will be like:

/set [sex/age/city]

I want so when you type /set sex, it shows: ".: Usage: /set [sex] [male/female] :."
but when you only type /set, it shows: ".: Usage: /set [sex] :."

Here is the command:

pawn Code:
dcmd_set(playerid,params[])
{
  new pName[MAX_PLAYER_NAME], File[256];
    GetPlayerName(playerid,pName,sizeof(pName));
  format(File,sizeof(File),"CLRP/Players/%s.ini",pName);
  if(params[0] == 0) return SendClientMessage(playerid,COLOR_GREY,".: Usage: /set [sex] :.");
    if(!strcmp(params[0],"sex"))
    {
      if(params[1] == 0) return SendClientMessage(playerid,COLOR_GREY,".: Usage: /set [sex] [male/female] :.");
      if(!strcmp(params[1],"male"))
        {
          dini_IntSet(File,"Sex",1);
          PlayerInfo[playerid][pSex] = 1;
            SendClientMessage(playerid,COLOR_GREENLIGHT,".: Info: Gender set to Male :.");
        }
        if(!strcmp(params[1],"female"))
        {
          dini_IntSet(File,"Sex",2);
          PlayerInfo[playerid][pSex] = 2;
            SendClientMessage(playerid,COLOR_GREENLIGHT,".: Info: Gender set to Female :.");
        }
    }
    return 1;
}

Thank you =)
__________________
"No problem can be solved from the same level of consciousness that created it." - Albert Einstein
introzen is offline