[AJUDA] Respawnveiculos - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [AJUDA] Respawnveiculos (
/showthread.php?tid=172342)
[AJUDA] Respawnveiculos -
[RoxX]Ygor - 29.08.2010
pawn Код:
if (strcmp("/respawnveiculos", cmdtext, true, 10) == 0)
if(IsPlayerAdmin(playerid)){
for(new v; v<MAX_VEHICLES; v++) SetVehicleToRespawn(v);
SendClientMessage(playerid, COLOR_WHITE, "Veiculos respawnados com secesso!.");
return 1;
}
Por que ele nгo ta funcionando alguem me ajuda ??
Re: [AJUDA] Respawnveiculos -
BlackFin - 29.08.2010
pawn Код:
if(strcmp(cmd, "/respawncarros", true) == 0 || strcmp(cmd, "/rc", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 3)
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo estб autorizado a usar este comando !");
return 1;
}
if(admtrampando[playerid] < 1)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/profadmin)");
return 1;
}
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "[BRL] Todos os carros foram para seus locais de inicio. By: %s.", playername);
SendClientMessageToAll(COLOR_RED,string);
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 <= CAR_RESPAW; car++)
{
if(!unwanted[car]) SetVehicleToRespawn(car);
}
}
return 1;
}
Re: [AJUDA] Respawnveiculos -
CyNiC - 29.08.2010
Assim:
pawn Код:
if (strcmp("/respawnveiculos", cmdtext, true, 10) == 0)
if(IsPlayerAdmin(playerid)){
for(new v; v<MAX_VEHICLES; v++){
SetVehicleToRespawn(v);
}
SendClientMessage(playerid, COLOR_WHITE, "Veiculos respawnados com secesso!.");
return 1;
}
Irб funcionar, agora se quiser adcionar o que o cara de cima postou, й bom, ficarб assim:
pawn Код:
if (strcmp("/respawnveiculos", cmdtext, true, 10) == 0)
if(IsPlayerAdmin(playerid)){
for(new v; v<MAX_VEHICLES; v++){
if(!IsVehicleOccupied(v)) SetVehicleToRespawn(v);
}
SendClientMessage(playerid, COLOR_WHITE, "Veiculos respawnados com secesso!.");
return 1;
}
stock IsVehicleOccupied(vehicleid)
{
for(new i = 0; i < MAX_PLAYERS; i++)//ou foreach, ou GetMaxPlayers, o que preferir
if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == PLAYER_STATE_DRIVER)
return 1;
return 0;
}