16.11.2010, 16:49
you cannot compare strings (text) through the control structure method (==).
You have to use the native function 'strcmp'
example
You have to use the native function 'strcmp'
example
pawn Код:
dcmd_login(playerid,params[])
{
new file[128],pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
format(file,sizeof(file),"dregister/users/%s",pName);
if(!dini_Exists(file)) return SendClientMessage(playerid,red,"ERROR:You arnt registered");
new temp;
temp = dini_Int(file,"Password");
if(!strcmp(params,temp))
{
SendClientMessage(playerid,yellow,"Welcome %s, you have been logged in");
PInfo[playerid][Logged] = 1;
PInfo[playerid][Score] = dini_Int(file,"Score");
PInfo[playerid][Cash] = dini_Int(file,"Cash");
}
return 1;
}