17.04.2013, 16:53
Hi this tutorial is a simple tutorial all it is , is that you can receive messages from in-game to your scriptfiles.
So lets say you don't have a site or can't afford one or don't want a ugly free one...![Smiley](images/smilies/smile.png)
You can create a command which lets your players report bugs and suggest suggestions from in-game.
You need Zcmd for this.
This is how it will look when you open Feedback.txt
[New Feedback]
Name: Randomdude
Bug: Test
So lets say you wanted to change this command to something of your own like report bugs this is how you would do it.
If you did all that it would look more like this in the Bug Reports.txt file.
[New Bug Report]
Name: RandomDude.
Bug: Test
Thanks for reading my simple tutorial if there are any mistakes you are free to correct me![Smiley](images/smilies/smile.png)
This is my first tutorial
If you want you can give me feedback on what I can improve on next time
Thanks!
So lets say you don't have a site or can't afford one or don't want a ugly free one...
![Smiley](images/smilies/smile.png)
You can create a command which lets your players report bugs and suggest suggestions from in-game.
You need Zcmd for this.
Quote:
CMD:feedback(playerid, params[]) { if (isnull(params)) return SendClientMessage(playerid,-1,# /feedback <feedback> Thank You.);//This is if the player does not type any feedback and only does /feedback new _msg[ 128 ], _msg2[ 128 ], player_name[ MAX_PLAYER_NAME ]; GetPlayerName(playerid, player_name, MAX_PLAYER_NAME); SendClientMessage(playerid,red,"The feedback you have given has gone through to the main office!");//This is to tell the player that there feedback has gone through format( _msg, sizeof ( _msg ), "Name: %s\r\n", player_name); format( _msg2, sizeof( _msg2), "Feedback: %s\r\n",params); new File: fileToWrite = fopen("Feedback.txt", io_append);//Feedback.txt is were all the feedback will go from your players.(It could get spammed -_-) fwrite(fileToWrite,"[New Feedback]\r\n");//Everytime a player types a new suggestion it will type [New Feedback] Underneath the other feedback. fwrite(fileToWrite, _msg); fwrite(fileToWrite, _msg2); fclose(fileToWrite); return 1; } |
[New Feedback]
Name: Randomdude
Bug: Test
![Smiley](images/smilies/smile.png)
So lets say you wanted to change this command to something of your own like report bugs this is how you would do it.
Quote:
CMD:feedback(playerid, params[]) //You would change feedback to the command you would like it to so like CMD:reportbug { if (isnull(params)) return SendClientMessage(playerid,-1,# /feedback <feedback> Thank You.);//You would also change this from "# /feedback <feedback> Thank You." To "# /reportbug <bug/bug's> Thank You." new _msg[ 128 ], _msg2[ 128 ], player_name[ MAX_PLAYER_NAME ]; GetPlayerName(playerid, player_name, MAX_PLAYER_NAME); SendClientMessage(playerid,red,"The feedback you have given has gone through to the main office!");//You would change the clientmessage to something like "The Bug Has Been Reported.". format( _msg, sizeof ( _msg ), "Name: %s\r\n", player_name); format( _msg2, sizeof( _msg2), "Feedback: %s\r\n",params); //Change "Feedback" to "Bug" new File: fileToWrite = fopen("Feedback.txt", io_append);//Change this from "Feedback.txt" to "Bug Reports.txt" fwrite(fileToWrite,"[New Feedback]\r\n");//Change "[New Feedback]" to "[New Bug Report]" fwrite(fileToWrite, _msg); fwrite(fileToWrite, _msg2); fclose(fileToWrite); return 1; } |
[New Bug Report]
Name: RandomDude.
Bug: Test
Thanks for reading my simple tutorial if there are any mistakes you are free to correct me
![Smiley](images/smilies/smile.png)
This is my first tutorial
![Tongue](images/smilies/razz.gif)
If you want you can give me feedback on what I can improve on next time
![Smiley](images/smilies/smile.png)
Thanks!