23.07.2012, 23:13
You can try something like this:
Lets say you have a stats command, and want to show the stats of someone else, using a command:
Hope you understand, will explain more thoroughly if needed.
Lets say you have a stats command, and want to show the stats of someone else, using a command:
pawn Код:
CMD:stats(playerid, params[])
{
new string[128];
format(string, 128, "Kills: %i", pInfo[playerid][kills]);
SendClientMessage(playerid, -1, string);
//Sends client message saying what your kills are
return 1;
}
//Whereever you want to show the dialog to see someones stat.
ShowPlayerDialog(playerid,666,DIALOG_STYLE_INPUT, "Stats", "Please type in the id of the player who you'd like to see there stats", "Continue", "Cancel");
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case 666:
{
new targetid, string[128];
targetid = strval(inputtext); //converts inputtext to an integer for the players id
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, -1, "That player is not connected");
format(string, 128, "Kills: %i", pInfo[targetid][kills]);
SendClientMessage(playerid, -1, string);
}
}
return 0;
}