Try what I said before:
Quote:
Originally Posted by Merlо
Try it:
pawn Код:
if(strcmp("/levelup", cmdtext, true) == 0) { if(gPlayerLogged[playerid] == 1) { if(PlayerInfo[playerid][pLevel] == 0) { if(nauda >= 1) { SendClientMessage(playerid, COLOR_WHITE, "[Info:] Tu nopirki 1 limeni"); SendClientMessage(playerid, COLOR_WHITE, "[Info:] Tagad tu vari izmantot komandu /count"); PlayerInfo[playerid][pLevel] = 1; } } } else SendClientMessage(playerid, COLOR_WHITE, "[Kluda:] Tev vispirms ir jaielogojas"); return 1; }
|
If it don't resolve, replace all your public OnPlayerCommandText with it:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new idx;
new string[256];
new cmd[256];
new tmp[256];
cmd = strtok(cmdtext, idx);
nauda = GetPlayerMoney(playerid);
if (strcmp(cmd, "/login", true) ==0 )
{
if(IsPlayerConnected(playerid))
{
new tmppass[64];
if(gPlayerLogged[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "[Kluda:] Tu jau esi ielogojies.");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "[***:] /login [parole]");
return 1;
}
strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
Encrypt(tmppass);
OnPlayerLogin(playerid,tmppass);
}
return 1;
}
if (strcmp(cmd, "/register", true) ==0 )
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "[Kluda:] Tu jau esi ielogojies.");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "Speletaji/%s.ini", sendername);
new File: hFile = fopen(string, io_read);
if (hFile)
{
SendClientMessage(playerid, COLOR_GREY, "[Kluda:] Sis niks jau ir aiznemts, izvelies citu.");
fclose(hFile);
return 1;
}
new tmppass[64];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "[***:] /register [parole]");
return 1;
}
strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
Encrypt(tmppass);
OnPlayerRegister(playerid,tmppass);
}
return 1;
}
if(strcmp("/levelup", cmdtext, true) == 0)
{
if(gPlayerLogged[playerid] == 1)
{
if(PlayerInfo[playerid][pLevel] == 0)
{
if(nauda >= 1)
{
SendClientMessage(playerid, COLOR_WHITE, "[Info:] Tu nopirki 1 limeni");
SendClientMessage(playerid, COLOR_WHITE, "[Info:] Tagad tu vari izmantot komandu /count");
PlayerInfo[playerid][pLevel] = 1;
}
}
}
else SendClientMessage(playerid, COLOR_WHITE, "[Kluda:] Tev vispirms ir jaielogojas");
return 1;
}
return 0;
}