13.06.2013, 11:55
Well i just make a derby script
Im confused about how to do this script : destroy or hide the vehicle after explode?
here's my derby script.
[^ TOP SCRIPT ^] It will direct this script when the player died..
Im confused about how to do this script : destroy or hide the vehicle after explode?
here's my derby script.
pawn Код:
if(InDerby[playerid] == 1)
{
DestroyVehicle(504);
timer[playerid][3] = SetTimerEx("LoadedObjects", 5000, false, "i", playerid);
timer[playerid][2] = SetTimerEx("Protection", 4000, false, "i", playerid);
new rand = random(sizeof(derbyspawns));
new veh = AddStaticVehicle(504,derbyspawns[rand][0],derbyspawns[rand][1],derbyspawns[rand][2],derbyspawns[rand][3],-1,-1);
SetVehicleVirtualWorld(veh, 50);
SetPlayerVirtualWorld(playerid, 50);
PutPlayerInVehicle(playerid,veh,0);
SetCameraBehindPlayer(playerid);
GameTextForPlayer(playerid, "~w~Objects Loading...", 4000, 3);
TogglePlayerControllable(playerid, 0);
SetPlayerInterior(playerid, 0);
SetPlayerFacingAngle(playerid, randspawn[rand][3]);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 35, 99999);
TextDrawHideForPlayer(playerid, Textdraw5);
TextDrawHideForPlayer(playerid, Textdraw4);
SetPlayerArmour(playerid, 0.0);
if(pInfo[playerid][VIP] >= 1) SetPlayerArmour(playerid, 100.0);
SetPlayerHealth(playerid, INFINITE);
timer[playerid][2] = SetTimerEx("Protection", 4000, false, "i", playerid);
SendClientMessage(playerid, COLOR_YELLOW, "To leave DM, /leavederby");
return 0;
}
pawn Код:
CMD:derbydm(playerid,params[])
{
new str[128];
if(UseDrug[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "[Error]: Cannot teleport, Current using drugs!");
if(GetPlayerState(playerid) != 1 && GetPlayerState(playerid) != 2 && GetPlayerState(playerid) != 3 && GetPlayerState(playerid) != 7)
return SendClientMessage(playerid, COLOR_RED, "[Spawned]: You must be spawned, To use this command!");
if(pInfo[playerid][Jail] == 1) return SendClientMessage(playerid, COLOR_RED, "[Error]: You are in jail, You cannot teleport!");
if(InHouse[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "[Error]: You are inside the House, Cannot teleport!");
if(InP[playerid] >= 1) return SendClientMessage(playerid, COLOR_RED, "[Error]: You cannot use this command while in Parkour!");
if(pInfo[playerid][Jail] == 1) return SendClientMessage(playerid, COLOR_RED, "[Error]: You cannot use this command while in Jail!");
if(God[playerid][0] == 1) return SendClientMessage(playerid, COLOR_RED, "[Error]: You cannot go to TDM/DM during your God Protection is on, Please try again when it's off!");
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, COLOR_RED, "[Error]: You cannot teleport while in Passenger seat!");
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "[Error]: You must be out of the vehicle before teleporting!");
if(pInfo[playerid][Freeze] == 1) return SendClientMessage(playerid, COLOR_RED, "[Error]: You are frozen, Cannot use this command!");
if(InDerby[playerid] == 1) return SendClientMessage(playerid,COLOR_RED,"[Error:] You are already in derby. Type /leavederby to exit derby dm");
new rand = random(sizeof(derbyspawns));
new veh = AddStaticVehicle(504,derbyspawns[rand][0],derbyspawns[rand][1],derbyspawns[rand][2],derbyspawns[rand][3],-1,-1);
PutPlayerInVehicle(playerid,veh,0);
SendClientMessage(playerid, COLOR_YELLOW, "[LeaveDM]: /leavederby to leave the dm!");
format(str, sizeof(str), "[DM]: %s(%d) has joined the Derby Deathmatch (/derbydm)", GetName(playerid), playerid);
InDerby[playerid] = 1;
return 1;
}