10.04.2010, 18:45
Quote:
|
Originally Posted by Cardinaal
Hey sorry for posting in this old topic.
I tried to use that script. It saves alright. The problem is when i type: /suggest.. It replies Suggestion Sent! and saves a empy suggestion in suggestions.txt but when i type /suggest Better streamer(example) it replies: USAGE: /suggest [text]. I don't know how to fix that, sorry. It should reply: USAGE /suggest [text] if you type only /suggest But now it replies USAGE /suggest [text] if you type /suggest You need this bla bla bla Help please? |
Here is a perfect one without any errors. Also, It posts the players name and the IP of the player who /suggest a command so if they abuse it, you can warn them about it.
Code:
if(strcmp(cmd, "/suggest", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new sendername[MAX_PLAYER_NAME];
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_BLUE, "USAGE: /suggest [text]");
return 1;
}
new ip[16]; GetPlayerIp(playerid, ip, sizeof(ip));
format(szstring, sizeof(szstring), "name: %s, IP: %s, Suggestion: %s.",sendername,ip,(result));
SendClientMessage(playerid, COLOR_YELLOW, szstring);
Suggestions(szstring);
}
return 1;
}

