[Tutorial] Don't have a site?
#1

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...
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;
}

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.
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;
}

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
This is my first tutorial
If you want you can give me feedback on what I can improve on next time
Thanks!
Reply


Messages In This Thread
Don't have a site? - by RandomDude - 17.04.2013, 16:53
Re: Don't have a site? - by Scenario - 17.04.2013, 16:59
Re: Don't have a site? - by RandomDude - 17.04.2013, 17:03
Re: Don't have a site? - by Vince - 17.04.2013, 19:07
Re: Don't have a site? - by Yves - 18.04.2013, 01:07
Re: Don't have a site? - by cazanova - 18.04.2013, 01:22
Re: Don't have a site? - by RandomDude - 18.04.2013, 14:59
Re: Don't have a site? - by thefatshizms - 18.04.2013, 15:44
Re: Don't have a site? - by RandomDude - 18.04.2013, 15:59
Re: Don't have a site? - by Bicentric - 18.04.2013, 16:06
Re: Don't have a site? - by RandomDude - 18.04.2013, 16:08
Re: Don't have a site? - by M3mPHi$_S3 - 18.04.2013, 17:26
Re: Don't have a site? - by RandomDude - 18.04.2013, 17:28
Re: Don't have a site? - by mahony0509 - 21.04.2013, 12:49
Re: Don't have a site? - by Syntax - 21.04.2013, 12:57
Re: Don't have a site? - by RandomDude - 21.04.2013, 17:14

Forum Jump:


Users browsing this thread: 1 Guest(s)