CMD:respawncars(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_WHITE, "{5CAD5C}Error: Your admin/helper level isn't high enough to use this command."); for(new i = 1; i < CAR_AMOUNT; i++) { SetVehicleToRespawn(i); } new string[60]; format(string, sizeof(string), "%s (%d) Respawncars %s %s", PlayerInfo[playerid][pName], playerid, GetDMY(1), GetHMS()); AdminLog(string); return 1; }
#define CAR_AMOUNT 900
for(new i=0; i < MAX_VEHICLES ;i++) { SetVehicleToRespawn(i); }
stock IsVehicleOccupied(vehicleid) { for(new i =0; i < MAX_PLAYERS; i++) { if(IsPlayerInVehicle(i,vehicleid)) { return 1; } } return 0; } for(new i=0; i < MAX_VEHICLES ;i++) { if(!IsVehicleOccupied(i)) SetVehicleToRespawn(i); }
for(new i = 1; i < CAR_AMOUNT; i++)
for (new i = 0; i < CAR_AMOUNT; i++)
for(new car = 1; car <= CAR_AMOUNT; car++)
How is correct?
Код HTML:
for(new i = 1; i < CAR_AMOUNT; i++) Код HTML:
for (new i = 0; i < CAR_AMOUNT; i++) |
public AdminLog(string[]) { new query[300]; query[0] = (EOS); new result2[300]; mysql_real_escape_string(string, result2); mysql_format(g_Sql, query, sizeof(query), "INSERT INTO log_admin (`log`) VALUES ('%s')",result2); mysql_query(g_Sql,query); return 1; }
stock GetDMY(info) { new string[20]; if(info) format(string, sizeof(string), "%02d/%02d/%d", gday, gmonth, gyear); else { getdate(gyear, gmonth, gday); gday += SetDay; gmonth += SetMonth; if(IsMonth31(gmonth)) { if(gday > 31) { gmonth += 1; if(gmonth > 12) { gmonth = 1; gyear += 1; while(gday > 31) gday -= 31; } else while(gday > 31) gday -= 31; } } else if(!IsMonth31(gmonth) && gmonth != 2) { if(gday > 30) { gmonth += 1; if(gmonth > 12) { gmonth = 1; gyear += 1; while(gday > 30) gday -= 30; } else while(gday > 30) gday -= 30; } } else if(!IsMonth31(gmonth) && IsMonth29(gyear) && gmonth == 2) { if(gday > 29) { gmonth += 1; if(gmonth > 12) { gmonth = 1; gyear += 1; while(gday > 29) gday -= 29; } else while(gday > 29) gday -= 29; } } else if(!IsMonth31(gmonth) && !IsMonth29(gyear) && gmonth == 2) { if(gday > 28) { gmonth += 1; if(gmonth > 12) { gmonth = 1; gyear += 1; while(gday > 28) gday -= 28; } else while(gday > 28) gday -= 28; } } format(string, sizeof(string), "%02d/%02d/%d", gday, gmonth, gyear); } return string; } stock GetDMYH(info) { new hour, minute, second, string[40]; gettime(hour, minute, second); FixTime(hour, minute); if(info) format(string, sizeof(string), "%02d/%02d/%d, %02d:%02d:%02d", gday, gmonth, gyear, hour, minute, second); else { getdate(gyear, gmonth, gday); gday += SetDay; gmonth += SetMonth; if(IsMonth31(gmonth)) { if(gday > 31) { gmonth += 1; if(gmonth > 12) { gmonth = 1; gyear += 1; while(gday > 31) gday -= 31; } else while(gday > 31) gday -= 31; } } else if(!IsMonth31(gmonth) && gmonth != 2) { if(gday > 30) { gmonth += 1; if(gmonth > 12) { gmonth = 1; gyear += 1; while(gday > 30) gday -= 30; } else while(gday > 30) gday -= 30; } } else if(!IsMonth31(gmonth) && IsMonth29(gyear) && gmonth == 2) { if(gday > 29) { gmonth += 1; if(gmonth > 12) { gmonth = 1; gyear += 1; while(gday > 29) gday -= 29; } else while(gday > 29) gday -= 29; } } else if(!IsMonth31(gmonth) && !IsMonth29(gyear) && gmonth == 2) { if(gday > 28) { gmonth += 1; if(gmonth > 12) { gmonth = 1; gyear += 1; while(gday > 28) gday -= 28; } else while(gday > 28) gday -= 28; } } format(string, sizeof(string), "%02d/%02d/%d, %02d:%02d:%02d", gday, gmonth, gyear, hour, minute, second); } return string; }
printf("%d respawned", i);