help me with command /frespawn -
Hugoca - 01.12.2012
Hi.I start making command /frespawn.I need if player is rank 6 and if it is in TEAM_BALLAS to respawn this cars:
pawn Код:
ballascars[0] = AddStaticVehicle(487,2492.16,2337.68,10.82,0,5,5); //62 Ballas - maverick
ballascars[1] = AddStaticVehicle(522,2513.53,2363.664,4.22,90.8875,5,5); //63 Ballas - NRG
ballascars[2] = AddStaticVehicle(579,2513.53,2372.72,4.21,90.9410,5,5); //64 Ballas - huntley1
ballascars[3] = AddStaticVehicle(560,2513.53,2377.27,4.21,90,5,5); //65 Ballas - sultan - sloji neon
ballascars[4] = AddStaticVehicle(567,2524.84,2372.72,4.21,270,5,5); //67 Ballas - savanna1
ballascars[5] = AddStaticVehicle(567,2524.84,2368.54,4.21,270,5,5); //68 Ballas - savanna2
ballascars[6] = AddStaticVehicle(541,2524.84,2381.26,4.21,270,5,5); // Bullet
ballascars[7] = AddStaticVehicle(411,2541.80,2372.67,4.21,90,5,5); // Infernus 2
and here is the command:
pawn Код:
if(strcmp(cmd, "/frespawn", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pRank] < 6)
{
SendClientMessage(playerid, COLOR_GRAD1, "Ти не си лидер!");
return 1;
}
else
{
for(new cars=0; cars<MAX_VEHICLES; cars++)
{
if(!VehicleOccupied(cars))
{
SetVehicleToRespawn(cars);
}
}
SendClientMessage(playerid,COLOR_RED, "Всички коли бяха respawn-ати!");
}
}
return 1;
}
Re: help me with command /frespawn -
Dark Killer - 01.12.2012
you are getting error?
post it here if yes
Re: help me with command /frespawn -
Hugoca - 01.12.2012
no...no...I need to modify this to respawn this cars:
pawn Код:
ballascars[0] = AddStaticVehicle(487,2492.16,2337.68,10.82,0,5,5); //62 Ballas - maverick
ballascars[1] = AddStaticVehicle(522,2513.53,2363.664,4.22,90.8875,5,5); //63 Ballas - NRG
ballascars[2] = AddStaticVehicle(579,2513.53,2372.72,4.21,90.9410,5,5); //64 Ballas - huntley1
ballascars[3] = AddStaticVehicle(560,2513.53,2377.27,4.21,90,5,5); //65 Ballas - sultan - sloji neon
ballascars[4] = AddStaticVehicle(567,2524.84,2372.72,4.21,270,5,5); //67 Ballas - savanna1
ballascars[5] = AddStaticVehicle(567,2524.84,2368.54,4.21,270,5,5); //68 Ballas - savanna2
ballascars[6] = AddStaticVehicle(541,2524.84,2381.26,4.21,270,5,5); // Bullet
ballascars[7] = AddStaticVehicle(411,2541.80,2372.67,4.21,90,5,5); // Infernus 2
Re: help me with command /frespawn -
Hugoca - 01.12.2012
bump
Re: help me with command /frespawn -
mamorunl - 01.12.2012
pawn Код:
for(new cars=0; cars<sizeof(ballascars); cars++)
{
if(!VehicleOccupied(ballascars[cars]))
{
SetVehicleToRespawn(ballascars[cars]);
}
}
Access the element in the array instead of just the vehicle id.
Re: help me with command /frespawn -
Konstantinos - 01.12.2012
pawn Код:
// --
if(strcmp(cmd, "/frespawn", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pRank] < 6 && /*TEAM_VARIABLE_HERE*/ != TEAM_BALLAS )
{
SendClientMessage(playerid, COLOR_GRAD1, "Ти не си лидер!");
return 1;
}
else
{
for(new cars=0; cars<8; cars++)
{
if(!VehicleOccupied(cars))
{
SetVehicleToRespawn(ballascars[cars]);
}
}
SendClientMessage(playerid,COLOR_RED, "Всички коли бяха respawn-ати!");
}
}
return 1;
}
Re: help me with command /frespawn -
Hugoca - 01.12.2012
Ok.But i wanna only if player is rank 6 on faction TEAM_BALLAS to respawn this cars
Re: help me with command /frespawn -
Hugoca - 01.12.2012
solved -.-