16.11.2013, 10:52
Dialogs sometimes conflict with other which have the same dialogid. So make sure that the dialogid of DIALOG_INVITEFR and DIALOG_ISFRIEND are not used anywhere else.
You can also debug it and see if it's called when a player responses to those dialogids
Test it and let us know whether it printed the messages or not.
PS: switch is faster than using if statement about dialogid.
You can also debug it and see if it's called when a player responses to those dialogids
pawn Код:
// ...
if(dialogid == DIALOG_INVITEFR)
{
if(response)
{
print("DIALOG_INVITEFR is being called..");
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)
{
print("DIALOG_ISFRIEND is being called..");
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;
}
PS: switch is faster than using if statement about dialogid.