Jump to content
  • 0

pomoc Auta


SwagManCZ

Dotaz

Ahoj, mám příkaz:

if (strcmp("/auto", cmdtext, true, 10) == 0)

{
        new Float:x;
        new Float:y;
        new Float:z;
        SetPlayerInterior(playerid,0);
        GetPlayerPos(playerid,x,y,z);
        new jmeno[MAX_PLAYER_NAME+1];
        new retezec[24+MAX_PLAYER_NAME+1];
        GetPlayerName(playerid, jmeno, sizeof(jmeno));
        format(retezec, sizeof(retezec), "Hráč %s si spawnul auto", jmeno);
        SendClientMessageToAll(svmodra, retezec);
        new veh;
        veh = CreateVehicle(565,x+2,y+2,z,310,random(150),random(150),-1);
        PutPlayerInVehicle(playerid, veh, 0);
        return 1;
 }
 
a potřebuju aby auto (veh) po minutě kdy je prázdné zmizelo ze serveru.
Poraďte mě pls někdo.
Link to comment
Share on other sites

1 odpověd na tuto otázku

Recommended Posts

  • 0
new DeleteVeh;

public OnPlayerExitVehicle

if(GetPlayerVehicleId(playerid) == veh) DeleteVeh=SetTimer("DVeh",60000,0);

public OnPlayerEnterVehicle

if(GetPlayerVehicleId(playerid) == veh) KillerTimer(DeleteVeh);
forward DVeh();

public DVeh(){
DestroyVehicle(DVeh);
return 1;
}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...