if(strcmp(cmd, "/leaveanote", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pAdmin] >= 1337) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /leaveanote [Note(TEXT)]"); return 1; } new note; note = strvalEx(tmp); { new File:log = fopen("/adminnotes.txt", io_write); fwrite(log, note);// this is line 27006 the line with the error fclose(log); format(string, sizeof(string), " You have left the note %s", note); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } } } return 1; }
C:\Users\Ryan\Desktop\World Wide RolePlay\gamemodes\WWRP.pwn(27006) : error 035: argument type mismatch (argument 2)
new vstr[64];
valstr(vstr,note);
fwrite(log, vstr);// this is line 27006 the line with the error
fwrite writes text so u must convert value to text
pawn Код:
|
if(strcmp(cmd, "/leaveanote", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pAdmin] >= 1337) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /leaveanote [Note(TEXT)]"); return 1; } new vstr[64]; new note; note = strvalEx(tmp); { new File:log = fopen("/adminnotes.txt", io_write); valstr(vstr,note); fwrite(log, vstr); fclose(log); format(string, sizeof(string), " You have left the note %s", vstr); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } } } return 1; }
if( strcmp( cmdtext, "/leavenote", true ) == 0 )
{
if( PlayerInfo[ playerid ][ pAdmin ] >= 1337 )
{
new
string[ 128 ],
File: open = fopen( "adminnotes.txt", io_append );
;
format( string, sizeof( string ), "%s", cmdtext[ 11 ] );
fwrite( open, string );
fclose( open );
}
return 1;
}