06.04.2015, 21:42
i have a problem with this code, i've made garage system with the house id, everything works except lock and unlock have a look on it.
and here's the stock of strmatch
Код:
CMD:lockgarage(playerid, params[])
{
new string[128];
for(new i = 0; i< sizeof(GarageInfo); i++)
{
if(IsPlayerInRangeOfPoint(playerid, 5, GarageInfo[i][gExteriorX], GarageInfo[i][gExteriorY], GarageInfo[i][gExteriorZ]) || IsPlayerInRangeOfPoint(playerid, 5, 1860.0675,-2347.2207,-37.4430))
{
if(strmatch(HouseInfo[GarageInfo[i][gHouseID]][hOwner],GetPlayerNameEx(playerid)))
{
if(!GarageInfo[i][gLock])
{
GarageInfo[i][gLock] = 1;
format(string, sizeof(string), "* %s unlocks their garage.", RPN(playerid));
ProxDetector(15.0, playerid, string, COLOR_ACCIONME, COLOR_ACCIONME, COLOR_ACCIONME, COLOR_ACCIONME, COLOR_ACCIONME);
GText(playerid, "~g~Garage Unlocked", 3500, 3);
}
else if(GarageInfo[i][gLock])
{
GarageInfo[i][gLock] = 0;
format(string, sizeof(string), "* %s locks their garage", RPN(playerid));
ProxDetector(15.0, playerid, string, COLOR_ACCIONME, COLOR_ACCIONME, COLOR_ACCIONME, COLOR_ACCIONME, COLOR_ACCIONME);
GText(playerid, "~r~Garage Locked", 3500, 3);
}
SaveGarages(i);
}
}
}
return 1;
}
Код:
stock strmatch(const String1[], const String2[])
{
if ((strcmp(String1, String2, true, strlen(String2)) == 0) && (strlen(String2) == strlen(String1)))
{
return true;
}
else
{
return false;
}
}


