SA-MP Forums Archive
/destroyv problem +REP!! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /destroyv problem +REP!! (/showthread.php?tid=443104)



/destroyv problem +REP!! - ewida - 10.06.2013

Hello guys, im have RP server and there Family/gangs cars...im make this command to remove the car But when I enter the car and tybe /destroy the car Deleted But when Restart server or Close the black windows and reopen the cars back... Help me please This the command what I have or who have another command give me
pawn Код:
CMD:destroyv(playerid, params[])
{
     new pName[MAX_PLAYER_NAME];
     new string[256]; // ; was missing
     new testcar= GetPlayerVehicleID(playerid);
     GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
     format(string, sizeof(string), "[Information]: %s has Destroyed a Vehicle !", pName);
     SendClientMessageToAll(0xFFFFFFFF, string);
     DestroyVehicle(testcar);
     return 1;
}
Thanks for Healpers!!


Re: /destroyv problem +REP!! - xFirex - 10.06.2013

what error dude


Re: /destroyv problem +REP!! - IceBilizard - 10.06.2013

try this one

pawn Код:
DelVehicle(vehicleid)
{
    for(new players=0;players<=MAX_PLAYERS;players++)
    {
        new Float:X,Float:Y,Float:Z;
        if (IsPlayerInVehicle(players,vehicleid))
        {
        GetPlayerPos(players,X,Y,Z);
        SetPlayerPos(players,X,Y,Z+2);
        SetVehicleToRespawn(vehicleid);
        }
        SetVehicleParamsForPlayer(vehicleid,players,0,1);
    }
    SetTimerEx("VehRes",3000,0,"d",vehicleid);
    return 1;
}
pawn Код:
dcmd_destroyv(playerid,params[])
{
    #pragma unused params
     if(IsPlayerInAnyVehicle(playerid))
     {
        DelVehicle(GetPlayerVehicleID(playerid));
        SendClientMessage(playerid,-1,"You've successfully Destroyed This car");
     }
     else
     {
        SendClientMessage(playerid,red,"Error: You must sit in the Car before using  this command!");
     }
    return 1;
}



Re: /destroyv problem +REP!! - Guest123 - 10.06.2013

Quote:
Originally Posted by IceBilizard
Посмотреть сообщение
try this one

pawn Код:
DelVehicle(vehicleid)
{
    for(new players=0;players<=MAX_PLAYERS;players++)
    {
        new Float:X,Float:Y,Float:Z;
        if (IsPlayerInVehicle(players,vehicleid))
        {
        GetPlayerPos(players,X,Y,Z);
        SetPlayerPos(players,X,Y,Z+2);
        SetVehicleToRespawn(vehicleid);
        }
        SetVehicleParamsForPlayer(vehicleid,players,0,1);
    }
    SetTimerEx("VehRes",3000,0,"d",vehicleid);
    return 1;
}
pawn Код:
dcmd_destroyv(playerid,params[])
{
    #pragma unused params
     if(IsPlayerInAnyVehicle(playerid))
     {
        DelVehicle(GetPlayerVehicleID(playerid));
        SendClientMessage(playerid,-1,"You've successfully Destroyed This car");
     }
     else
     {
        SendClientMessage(playerid,red,"Error: You must sit in the Car before using  this command!");
     }
    return 1;
}
he say after i restart his server, the vehicle was respawn so, his problem is

CreateVehicle



sorry if i am wrong