27.12.2015, 15:58
(
Последний раз редактировалось w3b; 27.12.2015 в 20:14.
Причина: How do I find the player that I wanted selected in dialogue?
)
Hi, how do I know which is the player that I selected in dialog.
Код:
if(strcmp(cmd, "/wanted2", true) == 0) { new count, namestr[MAX_PLAYER_NAME];//64 is too much since the max length of a name is like ~20 for(new i; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(PlayerData[i][pWantedLevel]!=0) { count++; GetPlayerName(i,namestr,MAX_PLAYER_NAME); if(!strlen(string)) { format(string,sizeof(string),"%s level: %d",namestr,PlayerData[i][pWantedLevel]); } else { format(string,sizeof(string),"\n%s level: %d",namestr,PlayerData[i][pWantedLevel]); } } } } ShowPlayerDialog(playerid,500, DIALOG_STYLE_LIST, "Wanted List.",string,"Ok", "Cancel"); if(count == 0)return SendClientMessage(playerid,0xFFFFFFFF,"There are no wanted Players"); return 1; }
Код:
if(dialogid == 500) { if(!response) { return 1; } if(PlayerData[PlayerSelectedInDialog][pWantedLevel] > 0) { new Float:x, Float:y, Float:z; GetPlayerPos(PlayerSelectedInDialog, x, y, z); SetPlayerCheckpoint(playerid, x,y,z, 3.0); return 1; } }