09.08.2014, 18:51
/Suggest CMD Tutorial!
Hi Guys today i will be showing how to make a /suggest (suggestion) cmd with saving the suggest in scriptfiles as suggestions.txt
So lets start
Add this in Top of the script/GM/FS (includes and the color we will be using ! )
pawn Код:
#define COLOR_YELLOW 0xFFFF00AA
#include <zcmd>
pawn Код:
CMD:suggest(playerid, params[])
{
if ( isnull ( params ) ) return SendClientMessage( playerid, -1, #Syntax /suggest <suggestion> );
new
_msg[ 128 ],
player_name[ MAX_PLAYER_NAME ];
GetPlayerName( playerid, player_name, MAX_PLAYER_NAME );
format( _msg, sizeof ( _msg ), "%s suggested: %s\r\n", player_name, params );
new File: fileToWrite = fopen("suggestions.txt", io_append);
fwrite(fileToWrite, _msg);
fclose(fileToWrite);
SendClientMessage(playerid, COLOR_YELLOW, "Thanks For Your Suggestion!!" );
return 1;
}
Last Thing ; add a .txt file in "scriptfiles" folder name it "suggestions" without " " and leave it empty!
/Suggest (suggestion) to suggest something then u will find the suggestion in that .txt file u created Enjoy! if i helped u please +rep me i will be thankfull!