03.05.2011, 15:28
Ok, so i orginally had the script called s&r or something cant remember the name of it.
I changed the /v around a bit so it suited my server a bit more.
So now i have this but theres this bug where one person can spawn a car and somebody else's vehicle will get deleted vice versa. Which ends up in people crying about it to me but ive not a clue at all how to solve this
I changed the /v around a bit so it suited my server a bit more.
So now i have this but theres this bug where one person can spawn a car and somebody else's vehicle will get deleted vice versa. Which ends up in people crying about it to me but ive not a clue at all how to solve this

Код:
dcmd_v(playerid, params[]) { new Float:Angle; new Index; new tmp[256]; tmp = strtok(params,Index); new car, string[128]; if(!IsNumeric(tmp)) car = GetVehicleModelIDFromName(tmp); else car = strval(tmp); if(car < 400 || car > 611) return SendClientMessage(playerid, red, "Usage: /v (vehicle name)"); if(SpawnedVehicles[playerid] != 0) DestroyVehicle(SpawnedVehicles[playerid]); new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z); if(GetPlayerVehicleID(playerid)) GetVehicleZAngle(GetPlayerVehicleID(playerid), Angle) && RemovePlayerFromVehicle(playerid); else GetPlayerFacingAngle(playerid,Angle); SpawnedVehicles[playerid] = CreateVehicle(car, X,Y,Z+1, Angle, -1, -1, 1200); PutPlayerInVehicle(playerid,SpawnedVehicles[playerid],0); SetVehicleZAngle(GetPlayerVehicleID(playerid), Angle); LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(playerid)); SetVehicleVirtualWorld(GetPlayerVehicleID(playerid),GetPlayerVirtualWorld(playerid)); format(string, sizeof(string), "You spawned a %s.", VehicleNames[car-400]); return SendClientMessage(playerid,sexyblue,string); }