08.02.2011, 14:23
i got a smiliar problem ill need to check a name after a result from a database and need to compared with the current name but i dont now how to do it
As you may see i tried it with different ways but not luck
pawn Код:
if(mysql_fetch_row(line)) //Fetches the line
{
new data[2];//The data strings
new data2[4]; //The data variables
GetPlayerName(playerid,pname,24);
sscanf(line, "p|dds",data2[1], data2[2],data[1]); //Splits the line with sscanf
//vehicleowner = data[1];
mysql_real_escape_string(data[1],vehicleowner);
mysql_real_escape_string(pname,escpname);
//format(string,sizeof(string),"%s != %s",escpname,vehicleowner);
if(GetPlayerName(playerid,pname,24) != vehicleowner[24])
{
SendClientMessage(playerid,COLOR_YELLOW,"You have been removed from the vehicle. You are not the owner");
format(string, sizeof(string), "This vehicle is registered to Player: %s",vehicleowner);
SendClientMessage(playerid, COLOR_YELLOW, string);
RemovePlayerFromVehicle(playerid);
mysql_free_result();
}]
