if(!strcmp(cmdtext, "/hitlist", true))
{
new count = 0;
SendClientMessage(playerid, COLOR_MSG, "Listing currently placed hits:");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && hit[i] > 0)
{
new string[256];
format(string, 256, "Hit on %s (%i) for $%i", ReturnPlayerName(i), i, hit[i]);
SendClientMessage(playerid, COLOR_FOUND, string);
count++;
}
}
if(count == 0)
{
SendClientMessage(playerid, COLOR_ERROR, "No hits placed at this time!");
}
}
if(!strcmp(cmdtext, "/hitlist", true))
{
new count = 0;
SendClientMessage(playerid, COLOR_MSG, "Listing currently placed hits:");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && hit[i] > 0)
{
new string[256];
format(string, 256, "Hit on %s (%i) for $%i", ReturnPlayerName(i), i, hit[i]);
SendClientMessage(playerid, COLOR_FOUND, string);
count++;
}
}
if(count == 0)
{
SendClientMessage(playerid, COLOR_ERROR, "No hits placed at this time!");
}
return 1;
}
if(strcmp(cmd, "/help", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(strlen(tmp) == 0) return SendClientMessage(playerid, ERROR, "Use: /help [MESSAGE]");
new string[250];
format(string, sizeof(string), "[ ! ] %s [ID:%d] asks : %s", name, playerid, strlen(tmp));
SendClientMessageToAdmins(string);
return 1;
}
if(strcmp(cmd, "/help", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(strlen(tmp) == 0) return SendClientMessage(playerid, ERROR, "Use: /help [MESSAGE]");
new string[144];// You don't need 250 cells, because max length displayable is 144
format(string, sizeof(string), "[ ! ] %s [ID:%d] asks : %s", name, playerid, tmp);/* < strlen returns the length of the string*/
SendClientMessageToAdmins(string);
return 1;
}
pawn Код:
|
Wiki says 144.
|
if(strcmp(cmdtext, "/help", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(strlen(tmp) == 0) return SendClientMessage(playerid, ERROR, "Use: /help [MESSAGE]");
new string[144];
new pName[MAX_PLAYER_NAME];
GetPlayerName(pName,sizeof(pName),playerid);//<---------------add this
format(string, sizeof(string), "[ ! ] %s [ID:%d] asks : %s", pName, playerid, cmdtext[6]);//put cmdtext[6], not tmp
SendClientMessageToAdmins(string);
return 1;
}
if(!strcmp(cmdtext, "/help", true, 5))
{
if(!cmdtext[5]) return SendClientMessage(playerid, ERROR, "Use: /help [MESSAGE]");
new strText[144], playerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
format(strText, sizeof(strText), "[ ! ] %s [ID:%d] asks : %s", playerName, playerid, cmdtext[5]);
SendClientMessageToAdmins(strText);
return 1;
}