Alcag 0 Odesláno: 2. Srpen, 2015 Share Odesláno: 2. Srpen, 2015 Dobry den nevite nekdo co stim je ? if(strcmp(cmd, "/vehdespawn", true) == 0 || strcmp(cmd, "/vhs", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pAdmin] < 3) { SendClientMessage(playerid, COLOR_GRAD1, " Nemlžeš použít tento příkaz!"); return 1; } new bool:unwanted[CAR_AMOUNT]; for(new player=0; player<MAX_PLAYERS; player++) { if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; } } for(new car = 1; car <= 268; car++) { if(!unwanted[car]) SetVehicleToRespawn(car); } GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "SERVER: "COL_WHITE"Všechny prázdné vozidla byly respawnuté Administrátorem: %s.", sendername); SendClientMessageToAll(COLOR_YELLOW,string); } return 1; } Link to comment Share on other sites More sharing options...
0 Globální moderátor Hip 191 Odesláno: 2. Srpen, 2015 Globální moderátor Share Odesláno: 2. Srpen, 2015 zkontroluj si závorky Link to comment Share on other sites More sharing options...
0 Josef_03 7 Odesláno: 2. Srpen, 2015 Share Odesláno: 2. Srpen, 2015 Aspoň napiš chyby, co by s tim melo byt? Link to comment Share on other sites More sharing options...
0 Alcag 0 Odesláno: 2. Srpen, 2015 Author Share Odesláno: 2. Srpen, 2015 Napíše to do chatu normalně že se všechny prázdné vozidla respawly ale nerespawnou se Link to comment Share on other sites More sharing options...
0 Globální moderátor Hip 191 Odesláno: 2. Srpen, 2015 Globální moderátor Share Odesláno: 2. Srpen, 2015 sorry za ty závorky, asi je dost pozdě - na mě, to byla závorka cyklu co mi přebejvala... for(new car = 1; car <= 268; car++) změn na: for(new car = 1; car < CAR_AMOUNT + 1; car++) Link to comment Share on other sites More sharing options...
0 Scydo 397 Odesláno: 3. Srpen, 2015 Share Odesláno: 3. Srpen, 2015 ~> Si to trochu pouprav, aby to vypadalo lépe, nemyslíš? stock IsVehicleEmpty(vehicleid) { for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++) if (IsPlayerInVehicle(i, vehicleid)) return (true); return (false); } if (!strcmp("/vehdespawn", cmdtext) || !strcmp("/vhs", cmdtext)) { if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_GRAD1, "Nemlžeš použít tento příkaz!"); new Name[MAX_PLAYER_NAME+1], sString[145]; GetPlayerName(playerid, Name, sizeof(Name)); for(new i = 1, j = GetVehiclePoolSize(); i <= j; i++) if (!IsVehicleEmpty(i)) SetVehicleToRespawn(i); format(sString, sizeof(sString), "SERVER: {FFFFFF}Všechny prázdné vozidla byly respawnuté Administrátorem: %s.", Name); SendClientMessageToAll(COLOR_YELLOW, sString); return (true); } Link to comment Share on other sites More sharing options...
0 Lukasz 336 Odesláno: 3. Srpen, 2015 Share Odesláno: 3. Srpen, 2015 ~> Si to trochu pouprav, aby to vypadalo lépe, nemyslíš? stock IsVehicleEmpty(vehicleid) { for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++) if (IsPlayerInVehicle(i, vehicleid)) return (true); return (false); } if (!strcmp("/vehdespawn", cmdtext) || !strcmp("/vhs", cmdtext)) { if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_GRAD1, "Nemlžeš použít tento příkaz!"); new Name[MAX_PLAYER_NAME+1], sString[145]; for(new i = 1, j = GetVehiclePoolSize(); i <= j; i++) if (!IsVehicleEmpty(i)) SetVehicleToRespawn(i); format(sString, sizeof(sString), "SERVER: {FFFFFF}Všechny prázdné vozidla byly respawnuté Administrátorem: %s.", Name); SendClientMessageToAll(COLOR_YELLOW, sString); return (true); } Chybi ti GetPlayerName a tohle reseni neni moc pekny. V jeho kodu projede vsechny hrace jednou a pak projede vozidla. U tebe projizdis vsechny hrace tolikrat, kolik mas vozidel.. Link to comment Share on other sites More sharing options...
0 Scydo 397 Odesláno: 3. Srpen, 2015 Share Odesláno: 3. Srpen, 2015 V jeho kodu projede vsechny hrace jednou a pak projede vozidla. U tebe projizdis vsechny hrace tolikrat, kolik mas vozidel.. ~> Neřekl jsem, ať to použije. Řekl jsme jen, ať si to poupraví. Link to comment Share on other sites More sharing options...
0 Lukasz 336 Odesláno: 3. Srpen, 2015 Share Odesláno: 3. Srpen, 2015 J, hodi si tam PoolSize a ma to ok. Link to comment Share on other sites More sharing options...
Dotaz
Alcag 0
Dobry den nevite nekdo co stim je ?
Link to comment
Share on other sites
8 odpovědí na tuto otázku
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now