14.10.2010, 19:41
Aqui, isso aqui ta tudo funfando, mas em vez de mandar SMS pro cara, manda pra vocк mesmo ¬¬
Como faзo pra pegar o "PlayerInfo[------][pPnumber]" do player clicado no TAB? que nem ta ali no OnPlayerCliclPlayer?
pawn Code:
if(dialogid == 222)
{
if(response == 0)
{
// PlayerInfo[playerid][pPhoneBook] = 0;
return 1;
}
if(response >= 1)
{
if(listitem == 0)
{
if(PlayerInfo[playerid][pPhoneBook] >= 1)
{
format(string,sizeof(string),"/ligar %d",PlayerInfo[playerid][pPnumber]);// <<<<<<
OnPlayerCommandText(playerid,string);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo tem uma agenda !");
return 1;
}
}
if(listitem == 1)
{
if(PlayerInfo[playerid][pPhoneBook] >= 1)
{
ShowPlayerDialog(playerid, 444, DIALOG_STYLE_INPUT, "Menu de SMS", "Digite a Mensagem", "Enviar", "Cancelar");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo tem uma agenda!");
return 1;
}
}
return 1;
}
return 1;
}
if(dialogid == 444)
{
if(response == 0)
{
// PlayerInfo[playerid][pPhoneBook] = 0;
return 1;
}
if(response >= 1)
{
format(string,sizeof(string),"/sms %d %s",PlayerInfo[playerid][pPnumber],inputtext); // <<<<<<
OnPlayerCommandText(playerid,string);
return 1;
}
return 1;
}
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
new string[256];
new pstring[256];
new plname[MAX_PLAYER_NAME];
// PlayerInfo[playerid][pPhoneBook] >= 1;
GetPlayerName(clickedplayerid, plname, sizeof(plname));
format(string, sizeof(string), "Menu do(a) %s", plname);
format(pstring, sizeof(pstring), "Ligar para %s\nMandar SMS para %s", plname,plname);
ShowPlayerDialog(playerid, 222, DIALOG_STYLE_LIST, string, pstring, "Confirmar", "Cancelar");
PlayerInfo[playerid][pPnumber] = PlayerInfo[clickedplayerid][pPnumber]; // <<<<<< olha aqui
return 1;
}