|
Originally Posted by jameskmonger
Put this at the VERY BOTTOM of your script.
Код:
stock DestroyAllVehicles()
{
for(new i;i<MAX_VEHICLES;i++)SetVehicleToRespawn(i);
}
|
|
Originally Posted by Don Correlli
Use this one:
Quote:
Quote:
|
|
Originally Posted by Don Correlli
Well, you wanted to destroy them, didn't you?
|
sorry if im expressing bad.
|
Originally Posted by Fedee!
Quote:
sorry if im expressing bad.What I want is to "destroy" spawned cars with the command /carname (ex: /jester, /turismo), and the other cars (AddStaticVehicles) just respawn to their normal site. Hope you can understand me now ![]() Thanks! |
stock RespawnAllVehicles()
{
for(new X = 1; X <= sizeof(SawnedVehicles); X++) if(SpawnedVehicles[X] != 0)DestroyVehicle(SpawnedVehicles[X]);
//change SpawnedVehicles to the variable where you save your spawned vehicles
for(new v = 1; v <= MAX_VEHICLES; v++) SetVehicleToRespawn(v);
}
|
Originally Posted by GTAguillaume
BTW: i guess i saw you hacking in SFR -.-
|
|
C:\Documents and Settings\Feche!\Escritorio\Server SAMP\filterscripts\respawn.pwn(42) : error 017: undefined symbol "SpawnedVehicles" C:\Documents and Settings\Feche!\Escritorio\Server SAMP\filterscripts\respawn.pwn(42) : error 036: empty statement C:\Documents and Settings\Feche!\Escritorio\Server SAMP\filterscripts\respawn.pwn(42) : error 017: undefined symbol "X" C:\Documents and Settings\Feche!\Escritorio\Server SAMP\filterscripts\respawn.pwn(42) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors. |


|
Originally Posted by [NWA
Hannes ]
Bump lol.. ![]() Quote:
|
stock RespawnAllVehicles()
{
for(new X; X <= sizeof(SpawnedVehicles); X++) if(SpawnedVehicles[X] != 0) DestroyVehicle(SpawnedVehicles[X]);
for(new v = 1; v <= MAX_VEHICLES; v++) SetVehicleToRespawn(v);
}
new SpawnedVehicles[200]; //change 200 to the max spawned vehicles
if (!strcmp("/turismo", cmd, true)) //change /turismo to the command
{
for(new i;i<sizeof(SpawnedVehicles);i++)
{
if(SpawnedVehicles[i] == 0)
{
new Float:X,Float:Y,Float:Z,Float:ROT;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerAngle(playerid,ROT
SpawnedVehicles[i] = CreateVehicle(MODEL,X,Y,Z,ROT,COLOR1,COLOR2); //change MODEL,COLOR1 and COLOR2
return 1;
}
return 1
}
|
Originally Posted by GTAguillaume
Change SpawnedVehicles to the variable where you save your spawned vehicles
Код:
stock RespawnAllVehicles()
{
for(new X; X <= sizeof(SpawnedVehicles); X++) if(SpawnedVehicles[X] != 0) DestroyVehicle(SpawnedVehicles[X]);
for(new v = 1; v <= MAX_VEHICLES; v++) SetVehicleToRespawn(v);
}
Код:
new SpawnedVehicles[200]; //change 200 to the max spawned vehicles Код:
if (!strcmp("/turismo", cmd, true)) //change /turismo to the command
{
for(new i;i<sizeof(SpawnedVehicles);i++)
{
if(SpawnedVehicles[i] == 0)
{
new Float:X,Float:Y,Float:Z,Float:ROT;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerAngle(playerid,ROT
SpawnedVehicles[i] = CreateVehicle(MODEL,X,Y,Z,ROT,COLOR1,COLOR2); //change MODEL,COLOR1 and COLOR2
return 1;
}
return 1
}
|
)
|
Originally Posted by GTAguillaume
RespawnAllVehicles() respawn all cars, and it destroy all spawned cars, but you will need to save all spawned cars. (Sorry for my english
) |
|
Originally Posted by Fedee!
Quote:
|
new SpawnedVehicles[200]; //change 200 to the max spawned vehicles
if (!strcmp("/turismo", cmd, true))
{
for(new i;i<sizeof(SpawnedVehicles);i++)
{
if(SpawnedVehicles[i] == 0)
{
new Float:X,Float:Y,Float:Z,Float:ROT;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerAngle(playerid,ROT);
SpawnedVehicles[i] = CreateVehicle(451,X,Y,Z,ROT,1,1);
SendClientMessage(playerid,0x00ff00AA,"You spawned succesfull a turismo!");
return 1;
}
return 1
}
|
Originally Posted by GTAguillaume
Quote:
Код:
new SpawnedVehicles[200]; //change 200 to the max spawned vehicles Код:
if (!strcmp("/turismo", cmd, true))
{
for(new i;i<sizeof(SpawnedVehicles);i++)
{
if(SpawnedVehicles[i] == 0)
{
new Float:X,Float:Y,Float:Z,Float:ROT;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerAngle(playerid,ROT);
SpawnedVehicles[i] = CreateVehicle(451,X,Y,Z,ROT,1,1);
SendClientMessage(playerid,0x00ff00AA,"You spawned succesfull a turismo!");
return 1;
}
return 1
}
|
|
I must do that for every car model right? |

|
Originally Posted by GTAguillaume
Quote:
![]() But you just need to change the command and the model ID. |
|
Originally Posted by Fedee!
Quote:
Edit: I hope that i dont bother you, but now i need a command that locks only 3 o 4 admins cars, is that possible? Thanks again! |
new admincars[4],bool:lockveh[4]; //lets make 4 admin cars ;)
admincars[0] = CreateVehicle(MODEL,X,Y,Z,ROT,COLOR1,COLOR2,RESPAWN_DELAY); //change MODEL, X,Y,Z,ROT,COLOR1, COLOR2 and respawn_delay admincars[1] = CreateVehicle(MODEL,X,Y,Z,ROT,COLOR1,COLOR2,RESPAWN_DELAY); //change MODEL, X,Y,Z,ROT,COLOR1, COLOR2 and respawn_delay admincars[2] = CreateVehicle(MODEL,X,Y,Z,ROT,COLOR1,COLOR2,RESPAWN_DELAY); //change MODEL, X,Y,Z,ROT,COLOR1, COLOR2 and respawn_delay admincars[3] = CreateVehicle(MODEL,X,Y,Z,ROT,COLOR1,COLOR2,RESPAWN_DELAY); //change MODEL, X,Y,Z,ROT,COLOR1, COLOR2 and respawn_delay
if (!strcmp("/lockadminvehicles", cmd, true))
{
if(lockveh == true) return SendClientMessage(playerid,0xff0000AA,"The cars are already locked!");
for(new i;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
for(new j;j<sizeof(admincars);j++) SetVehicleParamsForPlayer(admincars[j],playerid,0,1);
}
}
lockveh = true;
return 1;
}
if (!strcmp("/unlockadminvehicles", cmd, true))
{
if(lockveh == false) return SendClientMessage(playerid,0xff0000AA,"The cars are not locked!");
for(new i;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
for(new j;j<sizeof(admincars);j++) SetVehicleParamsForPlayer(admincars[j],playerid,0,0);
}
}
lockveh = false;
return 1;
}
if(lockveh)for(new i;i<sizeof(admincars);i++)if(admincars[i] == vehicleid && !IsPlayerAdmin(playerid)) SetVehicleParamsForPlayer(vehicleid,playerid,0,1);

bugs fixed
|
Originally Posted by manunited1878
Hey, i need script where you can just press Enter on the keyboard to enter a house/Biz...
|
#define PRESSED(%0) \ (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
if(PRESSED(KEY_SECONDARY_ATTACK)
{
if(IsPlayerInRangeOfPoint(playerid,5.0,X,Y,Z)) //change X,Y,Z
{
SetPlayerPos(playerid,X,Y,Z); //change X,Y,Z
SetPlayerInterior(playerid,INTERIOR); //change interior
}
}
|
Originally Posted by GTAguillaume
Quote:
Код:
new admincars[4],bool:lockveh; //lets make 4 admin cars ;) Код:
admincars[0] = CreateVehicle(MODEL,X,Y,Z,ROT,COLOR1,COLOR2,RESPAWN_DELAY); //change MODEL, X,Y,Z,ROT,COLOR1, COLOR2 and respawn_delay admincars[1] = CreateVehicle(MODEL,X,Y,Z,ROT,COLOR1,COLOR2,RESPAWN_DELAY); //change MODEL, X,Y,Z,ROT,COLOR1, COLOR2 and respawn_delay admincars[2] = CreateVehicle(MODEL,X,Y,Z,ROT,COLOR1,COLOR2,RESPAWN_DELAY); //change MODEL, X,Y,Z,ROT,COLOR1, COLOR2 and respawn_delay admincars[3] = CreateVehicle(MODEL,X,Y,Z,ROT,COLOR1,COLOR2,RESPAWN_DELAY); //change MODEL, X,Y,Z,ROT,COLOR1, COLOR2 and respawn_delay Код:
if (!strcmp("/lockadminvehicles", cmd, true))
{
if(lockveh == true) return SendClientMessage(playerid,0xff0000AA,"The cars are already locked!");
for(new i;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
for(new j;j<sizeof(admincars);j++) SetVehicleParamsForPlayer(admincars[j],playerid,0,1);
}
}
lockveh = true;
return 1;
}
Код:
if (!strcmp("/unlockadminvehicles", cmd, true))
{
if(lockveh == false) return SendClientMessage(playerid,0xff0000AA,"The cars are not locked!");
for(new i;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
for(new j;j<sizeof(admincars);j++) SetVehicleParamsForPlayer(admincars[j],playerid,0,0);
}
}
lockveh = false;
return 1;
}
Код:
if(lockveh)for(new i;i<sizeof(admincars);i++)if(admincars[i] == vehicleid && !IsPlayerAdmin(playerid)) SetVehicleParamsForPlayer(vehicleid,playerid,0,1); EDIT2: Done ![]() EDIT3: bugs fixed |
But i need 1 for each
i getting u crazy XDnew admincars[4],bool:lockveh[4]; //lets make 4 admin cars ;)
admincars[0] = CreateVehicle(MODEL,X,Y,Z,ROT,COLOR1,COLOR2,RESPAWN_DELAY); //change MODEL, X,Y,Z,ROT,COLOR1, COLOR2 and respawn_delay admincars[1] = CreateVehicle(MODEL,X,Y,Z,ROT,COLOR1,COLOR2,RESPAWN_DELAY); //change MODEL, X,Y,Z,ROT,COLOR1, COLOR2 and respawn_delay admincars[2] = CreateVehicle(MODEL,X,Y,Z,ROT,COLOR1,COLOR2,RESPAWN_DELAY); //change MODEL, X,Y,Z,ROT,COLOR1, COLOR2 and respawn_delay admincars[3] = CreateVehicle(MODEL,X,Y,Z,ROT,COLOR1,COLOR2,RESPAWN_DELAY); //change MODEL, X,Y,Z,ROT,COLOR1, COLOR2 and respawn_delay
if (!strcmp("/lockadminvehicle", cmd, true))
{
tmp = strtok(cmdtext,idx);
new ID = strval(tmp)-1;
if(ID < 0 || ID > sizeof(admincars)) return SendClientMessage(playerid,0xff0000AA,"Invalid ID!");
if(lockveh[ID] == true) return SendClientMessage(playerid,0xff0000AA,"The car is already locked!");
for(new i;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(admincars[ID],i,0,1);
}
}
lockveh[ID] = true;
return 1;
}
if (!strcmp("/unlockadminvehicles", cmd, true))
{
tmp = strtok(cmdtext,idx);
new ID = strval(tmp)-1;
if(ID < 0 || ID > sizeof(admincars)) return SendClientMessage(playerid,0xff0000AA,"Invalid ID!");
if(lockveh[ID] == false) return SendClientMessage(playerid,0xff0000AA,"The car is not locked!");
for(new i;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(admincars[ID],i,0,0);
}
}
lockveh[ID] = false;
return 1;
}
for(new i;i<sizeof(admincars);i++)if(admincars[i] == vehicleid && !IsPlayerAdmin(playerid) && lockveh[ID]) SetVehicleParamsForPlayer(vehicleid,playerid,0,1);

|
Originally Posted by GTAguillaume
(You need strtok for it)
On the top of your script: Код:
new admincars[4],bool:lockveh[4]; //lets make 4 admin cars ;) Код:
admincars[0] = CreateVehicle(MODEL,X,Y,Z,ROT,COLOR1,COLOR2,RESPAWN_DELAY); //change MODEL, X,Y,Z,ROT,COLOR1, COLOR2 and respawn_delay admincars[1] = CreateVehicle(MODEL,X,Y,Z,ROT,COLOR1,COLOR2,RESPAWN_DELAY); //change MODEL, X,Y,Z,ROT,COLOR1, COLOR2 and respawn_delay admincars[2] = CreateVehicle(MODEL,X,Y,Z,ROT,COLOR1,COLOR2,RESPAWN_DELAY); //change MODEL, X,Y,Z,ROT,COLOR1, COLOR2 and respawn_delay admincars[3] = CreateVehicle(MODEL,X,Y,Z,ROT,COLOR1,COLOR2,RESPAWN_DELAY); //change MODEL, X,Y,Z,ROT,COLOR1, COLOR2 and respawn_delay Код:
if (!strcmp("/lockadminvehicle", cmd, true))
{
tmp = strtok(cmdtext,idx);
new ID = strval(tmp)-1;
if(ID < 0 || ID > sizeof(admincars)) return SendClientMessage(playerid,0xff0000AA,"Invalid ID!");
if(lockveh[ID] == true) return SendClientMessage(playerid,0xff0000AA,"The car is already locked!");
for(new i;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(admincars[ID],i,0,1);
}
}
lockveh[ID] = true;
return 1;
}
Код:
if (!strcmp("/unlockadminvehicles", cmd, true))
{
tmp = strtok(cmdtext,idx);
new ID = strval(tmp)-1;
if(ID < 0 || ID > sizeof(admincars)) return SendClientMessage(playerid,0xff0000AA,"Invalid ID!");
if(lockveh[ID] == false) return SendClientMessage(playerid,0xff0000AA,"The car is not locked!");
for(new i;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(admincars[ID],i,0,0);
}
}
lockveh[ID] = false;
return 1;
}
Код:
for(new i;i<sizeof(admincars);i++)if(admincars[i] == vehicleid && !IsPlayerAdmin(playerid) && lockveh[ID]) SetVehicleParamsForPlayer(vehicleid,playerid,0,1); ![]() Usage: /lockadmincar ID (1-4) and /unlockadmincar ID (1-4) |