03.06.2010, 13:16
Hi,
I already asked this a few days ago but noone answered...
So i have a command for spawning some vehicles and a command for respawn all my vehicles but when i use the respawn command the ingamecreated vehicles (/spawn) respawn too.
But i only want to respawn the cars that are Static.
Please help.
CODE:
If you need more code just ask for it.
I already asked this a few days ago but noone answered...
So i have a command for spawning some vehicles and a command for respawn all my vehicles but when i use the respawn command the ingamecreated vehicles (/spawn) respawn too.
But i only want to respawn the cars that are Static.
Please help.
CODE:
pawn Код:
CMD:spawn(playerid, params[])
{
if (IsPlayerAdmin(playerid) || Player[playerid][ALevel] >= 1)
{
new Float:x;
new Float:y;
new Float:z;
new Float:a;
if (sscanf(params, "s", params[0]))
{
SendClientMessage(playerid, RED, "USAGE: /spawn [object]");
}
else if (!strcmp(params[0], gObjects[0], true))
{
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
CreateVehicle(522, x-3, y, z+5, a, 0, 0, -1);
}
else if (!strcmp(params[0], gObjects[1], true))
{
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
CreateVehicle(451, x-3, y, z+5, a, 0, 0, -1);
}
else if (!strcmp(params[0], gObjects[2], true))
{
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
CreateVehicle(425, x-5, y, z+5, a, 0, 0, -1);
}
else if (!strcmp(params, gObjects[3], true))
{
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
CreateVehicle(520, x-3, y, z+5, a, 0, 0, -1);
}
else
{
SendClientMessage(playerid, RED, "SERVER: Fahrzeug existiert nicht");
}
}
else
{
SendClientMessage(playerid, RED, "SERVER: Du bist nicht als Admin eingeloggt");
}
return 1;
}
pawn Код:
CMD:respawn(playerid, params[])
{
if (IsPlayerAdmin(playerid) || Player[playerid][ALevel] >= 2)
{
new command[64];
if (sscanf(params, "s", command))
{
SendClientMessage(playerid, RED, "USAGE: /respawn [befehl]");
}
else if (!strcmp(command, "autos", true))
{
new pname[256];
new string[256];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "*** %s hat die Autos respawnt.", pname);
SendClientMessageToAll(ORANGE, string);
for (new cars=0; cars<MAX_VEHICLES; cars++)
{
SetVehicleToRespawn(cars);
}
}
}
else
{
SendClientMessage(playerid, RED, "SERVER: Du bist nicht als Admin eingeloggt oder dein AdminLevel ist zu niedrig");
}
return 1;
}