SA-MP Forums Archive
playerid but NOT pid - 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)
+--- Thread: playerid but NOT pid (/showthread.php?tid=658662)



playerid but NOT pid - playstores - 09.09.2018

I just wanna give Wanteds over a dialog input, but It wont work, I tried it with a PVarInt & a Variable but nothing works

fahnden = player who is wanted

Quote:

if(dialogid == DIALOG_MDC)
{

if(response == 1)
{
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid,DIALOG_MDCCHECK,DIALOG_S TYLE_INPUT,"Player check","enter the exact username!!","enter","exit");
}
case 1:
{
ShowPlayerDialog(playerid,DIALOG_MDCFAHNDUNG,DIALO G_STYLE_INPUT,"Player Wanted","Enter the exact Username!","enter","exit");

}
}
}
return 1;
}
if(dialogid == DIALOG_MDCFAHNDUNG)
{
ShowPlayerDialog(playerid,DIALOG_MDCREASON,DIALOG_ STYLE_INPUT,"Player fahnden","Enter a Reason:","Go","Exit");
}
if(dialogid == DIALOG_MDCREASON)
{
if(!response) return 1;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsACop(i))
{


new pid = GetPVarInt(playerid,"FahndetName");

new string62[128];
format(string62, sizeof(string62), "HQ: Reporter: %s",GetName(playerid));
SendClientMessage(i, TEAM_BLUE_COLOR, string62);
format(string62, sizeof(string62), "HQ: %s is Wanted, Crime: %s",GetName(pid),inputtext);
SendClientMessage(i, TEAM_BLUE_COLOR, string62);
SendClientMessage(pid,-1,"test-you are wanted"); The Problem here: The Message is send to PLAYERiD and not pid
return 1;
}
}
}
return 1;

}


/edit:

Quote:

if (dialogid == DIALOG_MDCCHECK)
{

new mdccheck2 [128];
new pid;

new name [128];
// new pid = strval (inputtext);
********if (sscanf (inputtext, "u", pid))

// if (! response) return 1;

****if (pid == INVALID_PLAYER_ID) return SendClientMessage (playerid, -1, "The player is not online! Create a search offline");
*******// mysql_format (handle, strings, sizeof (string), "SELECT id, Username FROM user WHERE Username = '% e', pFirst = '% d', pFahndungGrund = '% e'", inputtext, PlayerInfo [playerid] [ pGefahndet] Player information [playerid] [pFahndungGrund]);
*****// mysql_format (handle, string, sizeof (string), "SELECT id, username FROM user WHERE username = '% e'", pname);
******// mysql_pquery (handle, strings, "MDCCheckForPlayer", "ds", playerid); // give UnBanForPlayer, otherwise it will not be called.
*****if (PlayerInfo [pid] [pForced] == 0) {Name = "No";}
if (PlayerInfo [pid] [pFiled]> = 1) {Name = "Yes";}
*******format (mdccheck2, sizeof (mdccheck2), "Name:% s \ nWill be searched:% s \ nVisited for:% s", GetName (pid), Name, PlayerInfo [pid] [pFahndungGrund]);
********Show Player dialog (playerid, 177, DIALOG_STYLE_MSGBOX, "data" mdccheck2, "Exit", "");
********// theMDCChecked [pid] = pid;
********SetPVarInt (playerid, "FahndetName" pid);
return 1;
}




Re: playerid but NOT pid - playstores - 09.09.2018

littl push


Re: playerid but NOT pid - coool - 09.09.2018

Don't inclose in [QUOTE] inclose in [PHP]


Re: playerid but NOT pid - CodeStyle175 - 09.09.2018

you dont return 1 in onplayerdialogresponse and what this code should even do?


Re: playerid but NOT pid - playstores - 09.09.2018

Quote:
Originally Posted by CodeStyle175
Посмотреть сообщение
you dont return 1 in onplayerdialogresponse and what this code should even do?
Quote:
Originally Posted by CodeStyle175
Посмотреть сообщение
you dont return 1 in onplayerdialogresponse and what this code should even do?

Its not easy to explain, just look at the code its self-explanatory.


/edit:

Addet DIALOG_MDCCHECK