Death after vehicle delete - 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: Death after vehicle delete (
/showthread.php?tid=455658)
Death after vehicle delete -
whando - 02.08.2013
Код:
if(strcmp(cmd, "/deletevehicle", true) == 0 || strcmp(cmd, "/dv", true) == 0)
{
new veh = GetPlayerVehicleID(playerid);
if(IsPlayerConnected(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
if(veh == PlayerVehicleID1[playerid])
{
ResetPlayerVehicle(playerid, 1);
OnPlayerSave(playerid);
format(string, sizeof(string), "Your vehicle have been deleted.");
SendClientMessage(playerid, COLOR_YELLOW, string);
}
else if(veh == PlayerVehicleID2[playerid])
{
ResetPlayerVehicle(playerid, 2);
OnPlayerSave(playerid);
format(string, sizeof(string), "Your vehicle have been deleted.");
SendClientMessage(playerid, COLOR_YELLOW, string);
}
else
{
SendClientMessage(playerid,COLOR_GREY," You are not in a vehicle that you own.");
}
}
else
{
SendClientMessage(playerid,COLOR_GREY," You are not driving a vehicle.");
}
}
return 1;
}
When I use the command my vehicle gets removed but I also get killed? I'm sure it's very easy to solve but I didn't script for a long time and I was not a pro at it, so please help me! :P.
Respuesta: Death after vehicle delete -
Marricio - 02.08.2013
Can you show us more code? (ResetPlayerVehicle, OnPlayerSave). Also, does the script have a "crash detect" system? Like when you crash the vehicle and the health is lowered.