function rac(playerid) { Loop(c,VEH) { if(IsAnOwnableCar©) { SetVehicleToRespawn©; SetVehiclePos(c, CarInfo[c][cLocationx],CarInfo[c][cLocationy],CarInfo[c][cLocationz]); SetVehicleZAngle(c, CarInfo[c][cAngle]); if( CarInfo[ c ][ cOwned ] == 1 ) SetVehicleParamsEx( c, 0, 0, 0, 1, 0, 0, 0 ); else SetVehicleParamsEx( c, 0, 0, 0, 0, 0, 0, 0 ); engineOn[c] = false; ChangeVehicleColor(c, CarInfo[c][cColorOne], CarInfo[c][cColorTwo]); AddCarTuning( c ); // Cr34 => } else if(!VehEnUso©) { SetVehicleToRespawn©; SetVehicleParamsEx( c, 0, 0, 0, 0, 0, 0, 0 ); engineOn[c] = false; } } new string[128] format(string, sizeof(string), "Respawn General realizado por: %s.", PlayerName(playerid)); BroadCast(COLOR_GREY,string); return 1; }
stock VehEnUso(vehid) { for (new i=0; i<MAX_PLAYERS; i++) if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i)) if(GetPlayerVehicleID(i) == vehid) return 1; return 0; }
stock VehEnUso(vehid)
{
new bool: nadie = false;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInAnyVehicle(i))
{
if(GetPlayerVehicleID(i) == vehid)
{
nadie = true;
break;
}
}
}
}
return nadie;
}
No puedo hablar espaсol, estaba pasando por la board Espaсol y vio a su pregunta sin respuesta, a ver si este nuevo cуdigo resuelve su problema:
PHP код:
|
Mira Samm si no me amas voy a tener que meterte una chancla por el occipital , pero yo se que si me amas ��❤
|
new VehicleExist[MAX_VEHICLES];
stock IsVehicleOcuppied(vehid)
{
new
getid;
foreach(new i: Player)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInAnyVehicle(i))
{
getid = GetPlayerVehicleID(i);
if(getid == vehid)
return true;
}
}
}
return false;
}
CMD:respawnall(playerid, params[])
{
new
str[128],
count=0;
for(new i=0; i<MAX_VEHICLES; i++)
{
if(VehicleExist[i] && !IsVehicleOcuppied(i))
{
SetVehicleToRespawn(i);
count++;
}
}
format(str, sizeof(str),"%d vehнculos han sido respawneados", count);
SendClientMessage(playerid, -1, str);
return 1;
}
CMD:createcar(playerid, params[])
{
new
Float:Pos[4];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
GetPlayerFacingAngle(playerid, Pos[3]);
new vehicle = CreateVehicle(411, Pos[0], Pos[1]+2, Pos[2], Pos[3], 1, 1, -1);
VehicleExist[vehicle] = true;
return 1;
}
CMD:racs(playerid, params[]) { for(new i=0; i<MAX_VEHICLES; i++) { if(!IsVehicleOcuppied(i)) { SetVehicleToRespawn(i); if( CarInfo[ i ][ cOwned ] == 1 ) SetVehicleParamsEx( i, 0, 0, 0, 1, 0, 0, 0 ); else SetVehicleParamsEx( i, 0, 0, 0, 0, 0, 0, 0 ); engineOn[i] = false; ChangeVehicleColor(i, CarInfo[i][cColorOne], CarInfo[i][cColorTwo]); AddCarTuning( i ); } } return 1; }
CMD:racs(playerid, params[])
{
for(new i=0; i<MAX_VEHICLES; i++)
{
if(!IsVehicleOcuppied(i))
{
SetVehicleToRespawn(i);
if( CarInfo[ i ][ cOwned ] == 1 )
{
SetVehicleParamsEx( i, 0, 0, 0, 1, 0, 0, 0 );
}
else
{
SetVehicleParamsEx( i, 0, 0, 0, 0, 0, 0, 0 );
engineOn[i] = false;
ChangeVehicleColor(i, CarInfo[i][cColorOne], CarInfo[i][cColorTwo]);
AddCarTuning( i );
}
}
}
return 1;
}
pawn Код:
|