if(strcmp(cmd,"/ver", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
tmp = strtok(cmdtext,idx);
new File:ver = fopen(tmp, io_read);
if(!fexist(tmp)) return SendClientMessage(playerid, -1,"Conta inexistente");
format(string,32, level: %d, PlayerInfo[tmp][pLevel]);fread(ver, string);
fclose(ver);
return 1;
}
}
if(!strcmp(cmdtext, "/status", true))
{
if(strlen(cmdtext) < 9)
return false;
new
arrStr[40],
File:file;
format(arrStr, 40, "%s.ini", cmdtext[9]);
file = fopen(arrStr, io_read)
if(!file)
return false;
while(fread(file, arrStr))
{
if(strfind(arrStr, "Password") != -1) continue;
SendClientMessage(playerid, -1, arrStr);
}
return 1;
}
if(!strcmp(cmdtext, "/ver", true)) {
if(!cmdtext[5]) return 1;
new string[MAX_PLAYER_NAME+10];
format(string, 24, "%s - %i", cmdtext[6], dini_Int(cmdtext[6], "Level");
SendClientMessage(playerid, -1, string);
return 1;
}
Nгo estб correto o cуdigo de Ricop.
Nгo coloque cmdtext[9], coloque strlen(cmdtext) < 9 Pois colocar cmdtext[9], caso o iterator 9 nгo existir, irб dar um erro no acesso da array. Seria como new array[5]; array[-1] = 10; Pode Crash no samp-server |
if(!strcmp(cmdtext,"/status", true, 6)) // status nome ?
{
static name[24];
if(sscanf(cmdtext,"s[24", name))
return SendClientMessage(playerid, -1,"ERRO: /status <Nome>");
static string[128], ah[30];
format(ah, sizeof(ah),"%s.ini", name);
if(!fexist(ah))
return SendClientMessage(playerid, -1,"Conta inexistente!");
format(string, sizeof(string),"Player: %s, Score: %d", name, dini_Get(ah,"Score"));
return SendClientMessage(playerid, -1, string);
}