17.04.2014, 05:10
Command must have the suffix does not help.
Код:
CMD:setname(playerid, params[]) { new playerb ,string[128], string2[128], file[64], idx, idx2, idx3, idx4, idx5, text[MAX_PLAYER_NAME]; if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command."); if(PlayerInfo[playerid][pAdmin] < 2 && !Approve[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command."); if(Approve[playerid]) Approve[playerid] = 0; // if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on admin duty."); if(sscanf(params, "us[24]", playerb, text)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setname [playerid] [name]"); if(aDuty[playerb]) return SendClientMessage(playerid, COLOR_GREY, "You can't set an admin on duty's name."); if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id."); // Start of detecting space in name new end, temp[32], temp2[32]; end = strfind(text, " ",true); if(end != -1) { strmid(temp, text, 0, end); format(temp, sizeof(temp), "%s_", temp); strdel(text, 0, end); strmid(temp2, text, 1, strlen(text)); format(text, 24, ""); strcat(text, temp, sizeof(temp)); strcat(text, temp2, sizeof(temp2)); } |
CMD:setname(playerid, params[])
{
new string[128], string2[128], file[64], idx, idx2, idx3, idx4, idx5, text[MAX_PLAYER_NAME];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 2 && !Approve[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(Approve[playerid]) Approve[playerid] = 0;
// if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on admin duty.");
if(sscanf(params, "s[24]", text)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setname [name]");
// Start of detecting space in name
new end, temp[32], temp2[32];
end = strfind(text, " ",true);
if(end != -1)
{
strmid(temp, text, 0, end);
format(temp, sizeof(temp), "%s_", temp);
strdel(text, 0, end);
strmid(temp2, text, 1, strlen(text));
format(text, 24, "");
strcat(text, temp, sizeof(temp));
strcat(text, temp2, sizeof(temp2));
}