pawn Код:
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;
}