//OnGameModeInit
carPM[1] = AddStaticVehicleEx(596,1460.5000000,-690.4000200,94.6000000,266.0000000,79,1,60000); // 14 linhas iguais a esse
CMD:rtc(playerid, params[])
{
new string[256];
if(Player[playerid][pPMRJ] >= 4)
{
for(new i; i < 14; i++)
{
SetVehicleToRespawn(carPM[i]);
format(string, sizeof(string), "{0000FF}HQ: Todas as unidades: Polнcial {ffffff}%s{0000FF} respawnou todos os carros da PM.", getPName(playerid));
SendMessageToCops(COR_ABATIDO, string);
return 1;
}
}
O problema й que quando eu uso o RTC ele nгo aconteзe nada os carros nгo voltam pra posiзгo inicial.
pawn Код:
|
CMD:rtc(playerid, params[])
{
if(Player[playerid][pPMRJ] >= 4)
{
new str[40], nome[24], bool:vehicle[MAX_VEHICLES];
GetPlayerName(playerid, nome, 24);
format(string, sizeof(string), "{0000FF}HQ: Todas as unidades: Polнcial {ffffff}%s{0000FF} respawnou todos os carros da PM.", getPName(playerid));
SendMessageToCops(COR_ABATIDO, string);
for(new j = 1; GetVehicleModel(j); ++j)
{
vehicle[j] = false;
for(new i, p = GetMaxPlayers(); i < p; ++i)
{
if(!IsPlayerInAnyVehicle(i) || !IsPlayerConnected(i)) continue;
if(IsPlayerInVehicle(i, j))
{
vehicle[j] = true;
break;
}
}
if(!vehicle[j]) SetVehicleToRespawn(j);
}
return 1;
}
Acho que o usuбrio acima jб concertou seu erro, sу lembre-se, mandar uma mensagem dentro de um loop й burrice, anгo ser que tenha uma condicional dentro dela para uma coisa especнfica.
Abraзos |
pawn Код:
|
CMD:rtc(playerid, params[])
{
if(Player[playerid][pPMRJ] >= 4)
{
new str[40], nome[24], bool:vehicle[MAX_VEHICLES];
GetPlayerName(playerid, nome, 24);
format(string, sizeof(string), "{0000FF}HQ: Todas as unidades: Polнcial {ffffff}%s{0000FF} respawnou todos os carros da PM.", getPName(playerid));
SendMessageToCops(COR_ABATIDO, string);
for(new j = 1; GetVehicleModel(j); ++j)
{
vehicle[j] = false;
for(new i, p = GetMaxPlayers(); i < p; ++i)
{
if(!IsPlayerInVehicle(playerid, carPM[1]) || !IsPlayerConnected(i)) continue;
if(IsPlayerInVehicle(i, j))
{
vehicle[j] = true;
break;
}
}
if(!vehicle[j]) SetVehicleToRespawn(j);
}
return 1;
}
Desculpa estragar sua festa, mas vocк copiou o cуdigo, deveria ao menos ter deixado os crйditos.
Sobre dar respawn em todos os carros, tente com esse cуdigo. PHP код:
|
Tinha esse cуdigo em meu GameMode, nгo mecho em pawn faz tempo apenas copiei e adaptei sobre os crйditos й possivel q tenha pegado o codigo de algum lado nгo me lembro de onde.
Peзo desculpa '-' |
CMD:rtc(playerid, params[])
{
new string[256];
if(Player[playerid][pPMRJ] >= 4)
{
for(new i = 0; i < sizeof(carPM); i++){ SetVehicleToRespawn(carPM[i]);}
format(string, sizeof(string), "{0000FF}HQ: Todas as unidades: Polнcial {ffffff}%s{0000FF} respawnou todos os carros da PM.", getPName(playerid));
SendMessageToCops(COR_ABATIDO, string);
}
return true;
}