Junior Spellweaver
- Joined
- Jan 5, 2015
- Messages
- 173
- Reaction score
- 194
Search :
Add Below :
Search:
You Will See This Code
Make it Look Like
Build Server
Then Users Can Spawn Cars On WZ_PVE With /spawncar Command
//PunisherZ Developer
Code:
if (strncmp(cmd, "/vspawn", 7) == 0 && plr->profile_.ProfileData.isDevAccount) return Cmd_VehicleSpawn(plr, cmd);
Add Below :
Code:
//RageZone Unique
if (strncmp(cmd, "/spawncar", 7) == 0 && plr->loadout_->GameMapId == GBGameInfo::MAPID_WZ_PVE)
return Cmd_VehicleSpawn(plr, cmd);
Search:
Code:
Cmd_VehicleSpawn
You Will See This Code
Code:
int ServerGameLogic::Cmd_VehicleSpawn(obj_ServerPlayer* plr, const char* cmd)
{
char buf[128];
int vehicleType = 0;
if(2 != sscanf(cmd, "%s %d", buf, &vehicleType))
return 1;
if (vehicleType < 0 || vehicleType > 3)
return 1;
r3dVector position = plr->GetPosition();
position.x += 3.0f;
char name[28];
sprintf(name, "Vehicle_%d_%p", obj_Vehicle::s_ListOfAllActiveVehicles.size() + 1, this);
obj_Vehicle* vehicle = (obj_Vehicle*)srv_CreateGameObject("obj_Vehicle", name, position);
vehicle->SetNetworkID(gServerLogic.GetFreeNetId());
vehicle->NetworkLocal = true;
vehicle->spawnObject = 0;
vehicle->spawnIndex = -1;
vehicle->SetVehicleType((obj_Vehicle::VehicleTypes)vehicleType);
vehicle->SetRotationVector(plr->GetRotationVector());
vehicle->OnCreate();
r3dOutToLog("[%s] Admin has spawned a vehicle.\n", plr->userName);
return 0;
}
Make it Look Like
Code:
int ServerGameLogic::Cmd_VehicleSpawn(obj_ServerPlayer* plr, const char* cmd)
{
char buf[128];
int vehicleType = 0;
if(2 != sscanf(cmd, "%s %d", buf, &vehicleType))
return 1;
if (vehicleType < 0 || vehicleType > 2)
return 1;
r3dVector position = plr->GetPosition();
position.x += 4.0f;
char name[28];
sprintf(name, "Vehicle_%d_%p", obj_Vehicle::s_ListOfAllActiveVehicles.size() + 1, this);
obj_Vehicle* vehicle = (obj_Vehicle*)srv_CreateGameObject("obj_Vehicle", name, position);
vehicle->SetNetworkID(gServerLogic.GetFreeNetId());
vehicle->NetworkLocal = true;
vehicle->spawnObject = 0;
vehicle->spawnIndex = -1;
vehicle->SetVehicleType((obj_Vehicle::VehicleTypes)vehicleType);
vehicle->SetRotationVector(plr->GetRotationVector());
vehicle->OnCreate();
r3dOutToLog("[%s] spawned a vehicle.\n", plr->userName);
return 0;
}
Build Server
Then Users Can Spawn Cars On WZ_PVE With /spawncar Command
//PunisherZ Developer