16.08.2009, 17:50
I tried and tried with many thing and shit but finally I ended up like this:
works exactly how I want it xD
Problem Solved, thanks
pawn Код:
dcmd_set(playerid,params[])
{
new pName[MAX_PLAYER_NAME], File[256],thing[3],value[6];
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(sscanf(params,"ss",thing,value))
if(strcmp(thing, "sex")) return SendClientMessage(playerid,COLOR_GREY,".: Usage: /set [sex] :.");
if(!strcmp(thing, "sex") && value[0] == 0) return SendClientMessage(playerid,COLOR_GREY,".: Usage: /set [sex] [male/female] :.");
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 if(strcmp(value, "female") || strcmp(value, "male")) return SendClientMessage(playerid,COLOR_GREY,".: Usage: /set [sex] [male/female] :.");
return 1;
}
Problem Solved, thanks