Guys i Have Create a Durby in my server and when a player death and veh explode player spawn with new veh and old vehicle spawn too so i want that vehicle distory or i tried too increase its respawn time but its not work here are code
PHP Code:
onplayerdeath
if(VDMS[playerid] == 1)
{
VDMS[playerid] = 1;
if(killerid != INVALID_PLAYER_ID)
{
if(GetPlayerState(killerid) == PLAYER_STATE_DRIVER)
{
new str[128];
format(str,sizeof(str),"%s Has Killed %s in Durby DeathMatch and Earn 15000.",killerid,playerid);
SendClientMessageToAll(COLOR_ORANGE,str);
SetPlayerScore(killerid,pInfo[killerid][pScore]++);
GivePlayerMoney(killerid,15000);
GameTextForPlayer(killerid,"Nice Shot!",3000,3);
GameTextForPlayer(playerid,"Well Tried.",3000,3);
PlayerPlaySound(killerid, 1149, 0.0, 0.0, 0.0);
DestroyVehicle(GetPlayerVehicleID(killerid));
if(IsPlayerInAnyVehicle(playerid)) DestroyVehicle(GetPlayerVehicleID(playerid));
}
}
}
CMD:ddm(playerid,params[])
{
if(pInfo[playerid][pSpawned] == 0) return SendClientMessage(playerid,COLOR_RED,Death_msg);
if(VDMS[playerid] == 1) return SendClientMessage(playerid, COLOR_RED,"YOU Are Already in Durby DeathMatch,");
if(pInfo[playerid][pTeleport] == 1)
{
new str[128],str1[128],Veh;
new Random = random(sizeof(RandomVDMS));
SetPlayerPosEx(playerid, RandomVDMS[Random][0], RandomVDMS[Random][1], RandomVDMS[Random][2],0.0,15,0);
SetPlayerFacingAngle(playerid, RandomVDMS[Random][3]);
Veh = CreateVehicle(504, RandomVDMS[Random][0], RandomVDMS[Random][1], RandomVDMS[Random][2],RandomVDMS[Random][3],2,2,200*60000);
SetCameraBehindPlayer(playerid);
LinkVehicleToInterior(Veh, 15);
PlayerInVDMS[playerid]++;
PutPlayerInVehicle(playerid, Veh,0);
GameTextForPlayer(playerid,"~y~Welcome to The ~r~Durby ~y~DeathMatch.",3000,3);
format(str,sizeof(str),"{84F6D7}%s: {FFA1AF}You Have Been Teleport To Durby DeathMatch.",PlayerName(playerid));
SendClientMessage(playerid,COLOR_RED,str);
format(str1,sizeof(str1),"%s: {FFA1AF}Has Been Teleport Durby DeathMatch. Type /ddm To Durby DeathMatch.",PlayerName(playerid));
SendClientMessageToAll(COLOR_LBLUE,str1);
pInfo[playerid][pTeleport] = 0;
VDMS[playerid] = 1;
return 1;
}
else
SendClientMessage(playerid,COLOR_RED,WAIT);
return 1;
}