23.06.2011, 09:58
There's a weird bug in my server when you spawn a car or an admin spawns a car. There are two different commands as I only allow players to spawn NRGs. But, when a player dies it'll wipe out all the NRGs also happens when a player leaves. Admins can only spawn one car at a time. If one admin spawns a car, then another, it will delete the car the first admin spawned. I use "pCar[playerid]" to keep track of vehicle IDs. It seems it spawns a car with "pCar[playerid]" but playerid being plain text.
- Thanks
ScottCFR
Код:
// Command COMMAND:nrg(playerid, params[]) { new Float:X, Float:Y, Float:Z, Float:A; GetPlayerPos(playerid, X, Y, Z); GetPlayerFacingAngle(playerid, A); Destroy(pCar[playerid]); pCar[playerid] = CreateVehicle(522, X, Y, Z, A, -1, -1, -1); LinkVehicleToInterior(pCar[playerid], GetPlayerInterior(playerid)); PutPlayerInVehicle(playerid, pCar[playerid], 0); return 1; } // OnPlayerDisconnect DestroyCar(pCar[playerid]); // OnPlayerDeath DestroyCar(pCar[playerid]);
ScottCFR