16.08.2009, 12:23
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:
Thank you =)
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;
}