31.07.2016, 20:25
PHP код:
else if(dialogid == 28)
{
new nlocalreffer[30];
if(!response)
{
SendClientMessage(playerid, -1, "YOU SELECT NO... SO NO ONE REFFER YOU!");
nlocalreffer = "Empty";
reffer[playerid] = nlocalreffer;
firstlogin[playerid] = false;
ChangeClass(playerid);
}
else if(response)
{
if(!strlen(inputtext))
{
SendClientMessage(playerid, -1, "YOU DONT WRITE A NAME... SO NO ONE REFFER YOU!");
nlocalreffer = "Empty";
reffer[playerid] = nlocalreffer;
firstlogin[playerid] = false;
ChangeClass(playerid);
}
else
{
format(nlocalreffer, sizeof nlocalreffer, inputtext);
if(!strcmp(nlocalreffer, PlayerName(playerid), true))
{
SendClientMessage(playerid, COLOR_LIGHTRED, "YOU CAN NOT PUT YOUR OWN NAME!");
QuemReferenciou(playerid);
return 1;
}
else
{ // sucesso
new query[160], refferername[MAX_PLAYER_NAME+1];
format(refferername,sizeof(refferername),"%s",inputtext);
mysql_format(ConnectMYSQL, query, sizeof(query), "SELECT Username FROM `accounts` WHERE `Username` = '%s'", refferername ); //SELECT * FROM accounts WHERE Name = %s TROQUE PELA QUAL ESTA NO SEU BANCO DE DADOS
mysql_function_query(ConnectMYSQL, query, true, "CheckRefferExist","is",playerid,refferername);
}
}
}
}