SA-MP Forums Archive
Dialog report help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Dialog report help (/showthread.php?tid=125515)



Dialog report help - nastoe - 04.02.2010

Код:
if(!strcmp(cmdtext, "/zalba", true))
{
  new FilePath[128];
  format(FilePath, sizeof(FilePath), "Admin/Zalbe/%s.ini", GetPlayerName(playerid));
  SendClientMessageToAll(0xFFFFFFAA, "Netko je napisao /zalba");
  ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Zalba na bilo sta vezano uz server", "\nUpisite opis zalbe i na sta se zalite nas tim ce pogledati zalbu", "Posalji", "Odustani");
  SendClientMessage(playerid,0xFFFFFFAA,"Zalba ce biti poslana admin timu, zahvaljujemo za zalbi...");
  return 1;
}
how to make when player write hes report and press "Posalji" / send to make new file into scriptfiles i try this

Код:
new FilePath[128];
			format(FilePath, sizeof(FilePath), "Admin/Korisnici/%s.ini", GetPlayerName(playerid));
but i get these errors

C:\Users\NASTIE\Desktop\KIKI\Las Venturas Party\samp03asvr_R4_win32\gamemodes\LvParty.pwn(33 0) : warning 202: number of arguments does not match definition
C:\Users\NASTIE\Desktop\KIKI\Las Venturas Party\samp03asvr_R4_win32\gamemodes\LvParty.pwn(33 0) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Warnings.


line 330 is:
Код:
format(FilePath, sizeof(FilePath), "Admin/Zalbe/%s.ini", GetPlayerName(playerid));



Re: Dialog report help - Babul - 04.02.2010

hm... try this:
Код:
if(!strcmp(cmdtext, "/zalba", true))
{
	new FilePath[128];
	new Name[32];
	format(FilePath, sizeof(FilePath), "Admin/Zalbe/%s.ini", GetPlayerName(playerid,Name,sizeof(Name)));
	SendClientMessageToAll(0xFFFFFFAA, "Netko je napisao /zalba");
	ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Zalba na bilo sta vezano uz server", "\nUpisite opis zalbe i na sta se zalite nas tim ce pogledati zalbu", "Posalji", "Odustani");
	SendClientMessage(playerid,0xFFFFFFAA,"Zalba ce biti poslana admin timu, zahvaljujemo za zalbi...");
	return 1;
}



Re: Dialog report help - lameguy - 04.02.2010

Код:
if(!strcmp(cmdtext, "/zalba", true))
{
  new Name[MAX_PLAYER_NAME];
  GetPlayerName(playerid, Name, sizeof(Name));
  
  new FilePath[128];
  format(FilePath, sizeof(FilePath), "Admin/Zalbe/%s.ini", Name);
  
  SendClientMessageToAll(0xFFFFFFAA, "Netko je napisao /zalba");
  ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Zalba na bilo sta vezano uz server", "\nUpisite opis zalbe i na sta se zalite nas tim ce pogledati zalbu", "Posalji", "Odustani");
  SendClientMessage(playerid,0xFFFFFFAA,"Zalba ce biti poslana admin timu, zahvaljujemo za zalbi...");
  return 1;
}
This should work.
GetPlayerName can't be used without any variable.
So GetPlayerName(playerid); doesnt work.

If you need to use GetPlayerName often, i recommend you to use stock like this:

Код:
stock PlayerName(playerid)
{
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
	return name;
}
and use
Код:
PlayerName(playerid);
when you need to get players name.





Re: Dialog report help - Babul - 04.02.2010

i agree with Johnson_boy, use HIS solution, its far better!!


Re: Dialog report help - nastoe - 04.02.2010

Quote:
Originally Posted by Johnson_boy
Код:
if(!strcmp(cmdtext, "/zalba", true))
{
  new Name[MAX_PLAYER_NAME];
  GetPlayerName(playerid, Name, sizeof(Name));
  
  new FilePath[128];
  format(FilePath, sizeof(FilePath), "Admin/Zalbe/%s.ini", Name);
  
  SendClientMessageToAll(0xFFFFFFAA, "Netko je napisao /zalba");
  ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Zalba na bilo sta vezano uz server", "\nUpisite opis zalbe i na sta se zalite nas tim ce pogledati zalbu", "Posalji", "Odustani");
  SendClientMessage(playerid,0xFFFFFFAA,"Zalba ce biti poslana admin timu, zahvaljujemo za zalbi...");
  return 1;
}
This should work.
GetPlayerName can't be used without any variable.
So GetPlayerName(playerid); doesnt work.

If you need to use GetPlayerName often, i recommend you to use stock like this:

Код:
stock PlayerName(playerid)
{
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
	return name;
}
and use
Код:
PlayerName(playerid);
when you need to get players name.


ty, now i dont get any of errors but when player write something in /zalba that what he write dont save in admin/zalbe can you help me?


Re: Dialog report help - nastoe - 04.02.2010

bump X


Re: Dialog report help - lameguy - 06.02.2010

Show your OnDialogResponse for dialog ID 2