Vehicle in DM zone
#1

How to make that if player in dm zone, he cant spawn vehicle? I maked this code:

Код:
public OnVehicleSpawn(vehicleid)
{
    for( new i = 0; i < MAX_PLAYERS; i++ )
    {
        if( IsPlayerConnected( i ) && !IsPlayerNPC( i ) && DM[ i ] == true ) DestroyVehicle( vehicleid );

    }
	return 1;
}
But when someone enter dm zone, all player's can't spawn cars. If I try to make something with playerid, I get error undefined symbol playerid.
Reply
#2

Instead of destroying it when it spawns*, why not just prevent them from spawning it in the first place..?

*OnVehicleSpawn is called when a vehicle RE-spawns, not on initial creation (though my include vfunc adds 'OnVehicleCreated'). This won't do anything anyway.
Reply
#3

Quote:
Originally Posted by MP2
Посмотреть сообщение
Instead of destroying it when it spawns*, why not just prevent them from spawning it in the first place..?

*OnVehicleSpawn is called when a vehicle RE-spawns, not on initial creation (though my include vfunc adds 'OnVehicleCreated'). This won't do anything anyway.
It work's, it destroy vehicle when someone in dm zone. How to prevent from spawning in the first place ?
Reply
#4

Try using your DM Zone in other Virtual World, so you can prevent it without extra plugins or includes.
Reply
#5

Quote:
Originally Posted by ]Rafaellos[
Посмотреть сообщение
Try using your DM Zone in other Virtual World, so you can prevent it without extra plugins or includes.
I maked that, but it still spawn cars.
Reply
#6

Did you add: "if(GetPlayerVirtualWorld(playerid) > 0) return SendClientMessage(playerid, -1, "You can't spawn Cars in DM.");" in your car spawn command?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)