#include <a_samp>
#include <YSI/y_ini>
#include "../include/gl_common.inc"
#include <string>
#define FILTERSCRIPT
#define COLOR_WHITE 0xFFFFFFFF
new PlayerName[MAX_PLAYER_NAME], Password[MAX_PASSWORD];
INI:playerlist[](playerid, name[], value[])
{
INI_String(PlayerName, Password, sizeof(Password));
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[]){
new idx;
new cmd[256];
cmd = strtok(cmdtext, idx);
if(strcmp("/ls", cmd, true) == 0){
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
INI_Load("playerlist.ini", true, playerid); // if set to true, playerid will be passed over to INI:playerlist[...
SendClientMessage(playerid, COLOR_WHITE, Password);
if(strcmp(Password, "") == 0){
ShowPlayerDialog(playerid, 30, 1, "Register", "To register you must first give in the first name of your character.", "OK", "Cancel");
return 1;
}
else{
ShowPlayerDialog(playerid, 33, 1, "Login", "Please give in your password.", "OK", "Cancel");
return 1;
}
}
return 0;
}
if(strlen(Password) == 0)
|
Comparing to an empty string will always return false, so that snippet of code won't work, instead of strcmp use strlen, for example:
pawn Код:
|
