/suggest command -
DaRkAnGeL[NBK] - 10.11.2011
Hey,
Could you help me with something ? I have started to use y_ini alot more then i used to, And currently using it on my RP Server how ever i want to find out if it is possible to create a command using it, here is the base:
pawn Код:
CMD:suggest(playerid,params[])
{
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessageEx(playerid,COLOR_GREY,"You cannot use that command");
else if(PlayerInfo[playerid][pLevel] > 3) return SendClientMessageEx(playerid,COLOR_GREY, "You need to be level 3");
else if(sscanf(params,"s", params)) return SendClientMessageEx(playerid,COLOR_WHITE,"Please Use /suggest <Feature>");
else
{
INI stuff
}
return 1;
}
Basically INI stuff would open the file and save the player name and the suggestion, but if it is possible like this:
Код:
[New Suggestion]
Name:
Suggests:
[New Suggestion]
Name:
Suggests:
Thats basically it so it would repeat for every suggestion, Is that possible?
Thanks
Re: /suggest command -
SmiT - 10.11.2011
Why not in a .txt file using regular functions ? -
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);
return true;
}
Re: /suggest command -
A7X_CEEJAY - 10.11.2011
I don't know the exact coding of it (I've not learnt that much yet xD), but what you'd do is;
(Use a command that has a log as an guideline)
Basically, you'd make the command that writes the messages as a log, With Date, time etc..
I'd do it for you but I'm not that good yet xD
Re: /suggest command -
DaRkAnGeL[NBK] - 10.11.2011
Not really what i was looking for, I am using y_ini for all my files, As a project for release thanks anyways
Re: /suggest command -
AdamCooper - 10.11.2011
i think you shouldnt do that.
even if u set level limit to 3.
ppl have to many ideas. better use forum
Re: /suggest command -
DaRkAnGeL[NBK] - 10.11.2011
Command finished
If you need the code:
pawn Код:
CMD:suggest(playerid, params[])
{
if (isnull(params)) return SendClientMessage(playerid,-1,#Syntax /suggest <suggestion>);
new
_msg[ 128 ],
_msg2[ 128 ],
player_name[ MAX_PLAYER_NAME ];
GetPlayerName(playerid, player_name, MAX_PLAYER_NAME);
format( _msg, sizeof ( _msg ), "Name: %s\r\n", player_name);
format( _msg2, sizeof( _msg2), "Suggestion: %s\r\n",params);
new File: fileToWrite = fopen("suggestions.txt", io_append);
fwrite(fileToWrite,"[New Suggestion]\r\n");
fwrite(fileToWrite, _msg);
fwrite(fileToWrite, _msg2);
fclose(fileToWrite);
return 1;
}