16.11.2013, 10:46
This is my OnDialogResponse.
Код HTML:
if(dialogid == DIALOG_INVITEFR) { if(response) { new str[128]; new friend[24]; new pid; if(!IsInvitedFriend(playerid, friend)) { AddFriend(playerid, friend); format(str, sizeof(str), "You invite %s to friends.", friend); SendClientMessage(playerid, Colour_Green, str); for(new i=0; i<MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(strcmp(GetPlayerNick(i), friend, true) == 0) { format(str, sizeof(str), "%s invited you to friends! '/accept %d' to accept friend.", GetPlayerNick(playerid), playerid); SendClientMessage(pid, Colour_Yellow, str); } } } } } return 1; } if(dialogid == DIALOG_ISFRIEND) { if(response) { switch(listitem) { case 0: { new Clickedplayerid = GetPVarInt(playerid, "Clicked"); new Float:x,Float:y,Float:z; GetPlayerPos(Clickedplayerid, x,y,z); SetPlayerPos(playerid, x,y,z+3); } } } return 1; } return 0; }