HELP WITH COMMAND
#1

how i can make if the car was didn't drive 3 minutes the car to be delete automatically

PHP код:
if (strcmp("/sultan"cmdtexttrue10) == 0)
    {
    if(
GetTickCount() - GetPVarInt(playerid"LastFLASH") < 120000) return SendClientMessage(playerid0xFF0000FF"you need to wait ");
    new 
Float:X,Float:Y,Float:Z,Float:Anglecarid;
    
GetPlayerPos(playerid,X,Y,Z);
    
GetPlayerFacingAngle(playerid,Angle);
    
carid GetPlayerVehicleID(playerid);
    
carid CreateVehicle(560,X,Y,Z,Angle,-1,-1,600);
    
AddVehicleComponent(carid,1029);
    
AddVehicleComponent(carid,1033);
    
AddVehicleComponent(carid,1139);
    
AddVehicleComponent(carid,1010);
    
AddVehicleComponent(carid,1073);
    
ChangeVehiclePaintjob(carid,1);
    
PutPlayerInVehicle(playerid,carid,0);
    
TogglePlayerControllable(playerid,true);
    
SetPVarInt(playerid"LastFLASH"GetTickCount());
    return 
SendClientMessage(playerid0x40FF40FF"sultan has been spawned!");
         }
    return 
1;
    } 
Reply
#2


pawn Код:
if( strcmp( "/sultan", cmdtext, true, 10 ) == 0 )
{
    if(GetTickCount() - GetPVarInt(playerid, "LastFLASH") < 120000) return SendClientMessage(playerid, 0xFF0000FF, "you need to wait ");
    new Float:X,Float:Y,Float:Z,Float:Angle, carid;
    GetPlayerPos(playerid,X,Y,Z);
    GetPlayerFacingAngle(playerid,Angle);
    carid = GetPlayerVehicleID(playerid);
    carid = CreateVehicle( 560, X, Y, Z, Angle, -1, -1, 180 );
    AddVehicleComponent(carid,1029);
    AddVehicleComponent(carid,1033);
    AddVehicleComponent(carid,1139);
    AddVehicleComponent(carid,1010);
    AddVehicleComponent(carid,1073);
    ChangeVehiclePaintjob(carid,1);
    PutPlayerInVehicle(playerid,carid,0);
    TogglePlayerControllable(playerid,true);
    SetPVarInt(playerid, "LastFLASH", GetTickCount());
    return SendClientMessage(playerid, 0x40FF40FF, "sultan has been spawned!");
}
Reply
#3

Quote:
Originally Posted by aRoach
Посмотреть сообщение

pawn Код:
if( strcmp( "/sultan", cmdtext, true, 10 ) == 0 )
{
    if(GetTickCount() - GetPVarInt(playerid, "LastFLASH") < 120000) return SendClientMessage(playerid, 0xFF0000FF, "you need to wait ");
    new Float:X,Float:Y,Float:Z,Float:Angle, carid;
    GetPlayerPos(playerid,X,Y,Z);
    GetPlayerFacingAngle(playerid,Angle);
    carid = GetPlayerVehicleID(playerid);
    carid = CreateVehicle( 560, X, Y, Z, Angle, -1, -1, 180 );
    AddVehicleComponent(carid,1029);
    AddVehicleComponent(carid,1033);
    AddVehicleComponent(carid,1139);
    AddVehicleComponent(carid,1010);
    AddVehicleComponent(carid,1073);
    ChangeVehiclePaintjob(carid,1);
    PutPlayerInVehicle(playerid,carid,0);
    TogglePlayerControllable(playerid,true);
    SetPVarInt(playerid, "LastFLASH", GetTickCount());
    return SendClientMessage(playerid, 0x40FF40FF, "sultan has been spawned!");
}
This will just respawn the vehicle after 3 minutes. You should use a timer for this if you want the vehicle to be deleted
Reply
#4

Try with this:
Reply
#5

can you make it more smaller
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)