15.05.2014, 11:45
[HELP] Duble Message
15.05.2014, 11:48
"Are we meant to guess your code?" -******.
15.05.2014, 12:13
pawn Код:
if(strcmp(cmd, "/hc", true) == 0 || strcmp(cmd, "/hchat", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_YELLOW2, "USAGE: (/hchat) [chat]");
return 1;
}
if (PlayerInfo[playerid][pHelper] >= 1)
format(string, sizeof(string), "{1DFB04}Chat - [Helper] %s : %s **", sendername, result);
else if (PlayerInfo[playerid][pAdmin] >= 1)
format(string, sizeof(string), "{1DFB04}Chat - [Admin] %s : %s **", sendername, result);
{
SendHelperMessage(COLOR_YELLOW2, string);
} SendAdminMessage(COLOR_YELLOW2, string);
}
return 1;
}
15.05.2014, 12:15
Why don't you use sscanf, it's the simple and best way for the params..
15.05.2014, 12:17
Can you give me a link or tutorial?
15.05.2014, 12:19
15.05.2014, 12:20
And what this plugin helps me?
15.05.2014, 12:21
15.05.2014, 12:22
15.05.2014, 12:47
Quote:
Код:
if(strcmp(cmd, "/hc", true) == 0 || strcmp(cmd, "/hchat", true) == 0) { if(IsPlayerConnected(playerid)) { GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_YELLOW2, "USAGE: (/hchat) [chat]"); return 1; } if (PlayerInfo[playerid][pHelper] >= 1) format(string, sizeof(string), "{1DFB04}Chat - [Helper] %s : %s **", sendername, result); else if (PlayerInfo[playerid][pAdmin] >= 1) format(string, sizeof(string), "{1DFB04}Chat - [Admin] %s : %s **", sendername, result); { SendHelperMessage(COLOR_YELLOW2, string); } SendAdminMessage(COLOR_YELLOW2, string); } return 1; } |
« Next Oldest | Next Newest »
Users browsing this thread: 2 Guest(s)