19.07.2015, 07:23
PHP код:
YCMD:clean(playerid, params[], help){
print("works");
mysql_query("SELECT pName,WorkId, WorkContract FROM users WHERE WorkId > '-1'");
mysql_store_result();
new vardas[MAX_PLAYER_NAME], darboid, darboKontraktas, resultline[300];
while(mysql_fetch_row_format(resultline))
{
sscanf(resultline,"p<|>s[24]ii",vardas, darboid, darboKontraktas);
if(gettime() > darboKontraktas){
if(GetPlayeridMid(vardas) != INVALID_PLAYER_ID) return 0;
format(g_szBuffer, sizeof g_szBuffer, "UPDATE `"MySQL_PLAYERS_TABLE"` SET `WorkId` = '-1', `WorkStatus` = '0', `WorkPoints` = '0', `WorkWarns` = '0', `WorkRank` = '0' WHERE pName = '%s'", vardas);
mysql_query(g_szBuffer);
frakcija[darboid][fSlotUsed] -= 1;
updateFractionLabel(darboid);
format(zinute, 128, "{A17800}[ %s ]{785A00} darbuotojo {A17800}%s{785A00} darbo kontrakto laikas baigėsi, jis iљmestas.", GetPlayerRadioJob(darboid), vardas);
SendMessageToFraction(darboid, zinute);
printf("%s zaidejui kontraktas baigesi", vardas);
}
}
mysql_free_result();
return 1;
}
On this part:
PHP код:
if(GetPlayeridMid(vardas) != INVALID_PLAYER_ID) return 0;
DEBUG:
PHP код:
[17:06:54] CMySQLHandler::Query(SELECT pName,WorkId, WorkContract FROM users WHERE WorkId > '-1') - Successfully executed.
[17:06:54] >> mysql_store_result( Connection handle: 1 )
[17:06:54] CMySQLHandler::StoreResult() - Result was stored.
[17:06:54] >> mysql_fetch_row_format( Connection handle: 1 )
[17:06:54] CMySQLHandler::FetchRow() - Return: Trevor_Phillipss|7|1437219760