public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if (newkeys & KEY_FIRE && GetPVarInt(playerid, "DriveThruID") != 0) { new id = GetPVarInt(playerid, "DriveThruID"), szString[192], Float, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); GetPVarString(playerid, "DriveThruName", szString, 192); DriveThruInfo[id][driveThruModel] = 2353; DriveThruInfo[id][driveThruBiz] = GetPVarInt(playerid, "DriveThruBiz"); DriveThruInfo[id][driveThruX] = GetPVarFloat(playerid, "DriveThruX"); DriveThruInfo[id][driveThruY] = GetPVarFloat(playerid, "DriveThruY"); DriveThruInfo[id][driveThruZ] = GetPVarFloat(playerid, "DriveThruZ"); DriveThruInfo[id][driveThruOrderX] = x; DriveThruInfo[id][driveThruOrderY] = y; DriveThruInfo[id][driveThruOrderZ] = z; format(DriveThruInfo[id][driveThruName], 128, szString); DriveThruInfo[id][driveThruPickup1] = CreateDynamicPickup(2353, 23, DriveThruInfo[id][driveThruX], DriveThruInfo[id][driveThruY], DriveThruInfo[id][driveThruZ]); DriveThruInfo[id][driveThruPickup2] = CreateDynamicPickup(2353, 23, DriveThruInfo[id][driveThruOrderX], DriveThruInfo[id][driveThruOrderY], DriveThruInfo[id][driveThruOrderZ]); format(szString, sizeof(szString), "{01FCFF}[%s]{F0CC00}\nYou can order food here!\nDrive Thru ID: %d\n[/order]", DriveThruInfo[id][driveThruName], id); DriveThruInfo[id][driveThruLabel1] = CreateDynamic3DTextLabel(szString, COLOR_DCHAT, DriveThruInfo[id][driveThruX], DriveThruInfo[id][driveThruY], DriveThruInfo[id][driveThruZ] + 0.75, 10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 0, -1, -1, 100.0); DriveThruInfo[id][driveThruLabel2] = CreateDynamic3DTextLabel("Drive into this checkpoint to get your food!", COLOR_DCHAT, DriveThruInfo[id][driveThruOrderX], DriveThruInfo[id][driveThruOrderY], DriveThruInfo[id][driveThruOrderZ] + 0.75, 10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 0, -1, -1, 100.0); DriveThruInfo[id][driveThruTaken] = 1; format(szString, sizeof(szString), "You have created a Drive Thru: %s (ID: %d).", DriveThruInfo[id][driveThruName], id); SendClientMessage(playerid, 0x33AA33FF, szString); DeletePVar(playerid, "DriveThruID"); SaveDriveThrus(); return 1; } |
I am using this script https://sampforum.blast.hk/showthread.php?tid=450253
The problem is that, when we sit in a vehicle, it's camera is inner. I want that the default camera in san andreas. WE have to enter this command to get it into the default san andreas camera (/togglecam) Can anyone remove this /togglecam and make the camera by default? P.s Can any one tell me that 50.7.65.90:4500 Which gamemode is using this server? I need the exact name of this mod.. I have seen zGaming but it's change from zGaming. |
public OnPlayerStateChange(playerid, newstate, oldstate) { new string[128]; if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER) { //new newcar = GetPlayerVehicleID(playerid); ShowSpeed[playerid] = 1; /*if(GetVehicleModel(newcar) != 509 && GetVehicleModel(newcar) != 481) // BMX & Bike { RadioChoose(playerid, Radio[newcar]); }*/ } /*if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER) { new vehicleid = GetPlayerVehicleID(playerid), playingid = v_VehicleInfo[vehicleid][RadioPlaying]; #if USE_TEXTDRAW_SET == 2 new string[50]; format(string,sizeof(string),"Listening to: ~n~~w~%s",r_RadioInfo[playingid][r_Name]); TextDrawSetString(v_VehicleInfo[vehicleid][r_Draw],string); #else TextDrawSetString(v_VehicleInfo[vehicleid][r_Draw],r_RadioInfo[playingid][r_Name]); #endif TextDrawShowForPlayer(playerid,v_VehicleInfo[vehicleid][r_Draw]); SetPVarInt(playerid,"ID_HideRadioTextdraw",SetTime rEx("HideRadioTextdraw",TEXTDRAW_DISAPPEAR_TIME,fa lse,"ii",playerid,vehicleid)); PlayAudioStreamForPlayer(playerid,r_RadioInfo[playingid][r_Link]); SetPVarInt(playerid,"ID_OldVehicle",vehicleid); return 1; } if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER) { new vehicleid = GetPVarInt(playerid,"ID_OldVehicle"), timer = GetPVarInt(playerid,"ID_HideRadioTextdraw"); if(timer != -1) { TextDrawHideForPlayer(playerid,v_VehicleInfo[vehicleid][r_Draw]); KillTimer(timer); } StopAudioStreamForPlayer(playerid); }*/ /*if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER) { new gastext[41]; new vid = GetPlayerVehicleID(playerid); format(gastext, sizeof(gastext), "Vehicle Fuel : %d", Gas[vid]); TextDrawSetString(GasAmount, gastext); TextDrawShowForPlayer(playerid, GasAmount); } if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER) { TextDrawHideForPlayer(playerid, GasAmount); }*/ if(newstate == PLAYER_STATE_DRIVER) { if(GetPVarInt(playerid,"used") == 0) { new p = GetPlayerVehicleID(playerid); pObj[playerid] = CreatePlayerObject(playerid,19300, 0.0000, -1282.9984, 10.1493, 0.0000, -1, -1, 100); AttachPlayerObjectToVehicle(playerid,pObj[playerid],p,-0.314999, -0.195000, 0.510000, 0.000000, 0.000000, 0.000000); AttachCameraToPlayerObject(playerid,pObj[playerid]); SetPVarInt(playerid,"used",1); } } else if(GetPVarInt(playerid,"used") == 1) { SetCameraBehindPlayer(playerid); DestroyPlayerObject(playerid,pObj[playerid]); SetPVarInt(playerid,"used",0); } if(newstate == PLAYER_STATE_ONFOOT) { if(GetPVarInt(playerid,"used") == 1) { SetPVarInt(playerid,"used",0); SetCameraBehindPlayer(playerid); DestroyPlayerObject(playerid,pObj[playerid]); } } if (newstate == PLAYER_STATE_DRIVER) { if (GetPVarInt(playerid, "StartMoving") && GetVehicleModel(GetPlayerVehicleID(playerid)) != 414) { SendClientMessage(playerid, LIGHTRED, "* You have failed the moving job because you've left your truck."); DeletePVar(playerid, "StartMoving"); DeletePVar(playerid, "MovingCash"); DisablePlayerCheckpoint(playerid); CP[playerid] = 0; } } if(newstate == PLAYER_STATE_PASSENGER) { if(GetPlayerVehicleID(playerid) == NPCBlueBus) { SetPlayerVirtualWorld(playerid, 2); SetPlayerPos(playerid, 2021.9740,2235.6626,2103.9536); SetPlayerFacingAngle(playerid, 355.3504); SetCameraBehindPlayer(playerid); SetPlayerInterior(playerid, 1); BusID[playerid] = 1; GameTextForPlayer(playerid, "~w~Bus A-1", 3000, 1); costtimer = SetTimerEx("CostTimer", 30000, 1, "d", playerid); SendClientMessage(playerid, -1,"You have entered the bus - Please take a seat"); BusCost[playerid] += 2; } |
if(newstate == PLAYER_STATE_DRIVER)
{
if(GetPVarInt(playerid,"used") == 0)
{
new p = GetPlayerVehicleID(playerid);
pObj[playerid] = CreatePlayerObject(playerid,19300, 0.0000, -1282.9984, 10.1493, 0.0000, -1, -1, 100);
AttachPlayerObjectToVehicle(playerid,pObj[playerid],p,-0.314999, -0.195000, 0.510000, 0.000000, 0.000000, 0.000000);
AttachCameraToPlayerObject(playerid,pObj[playerid]);
SetPVarInt(playerid,"used",1);
}
}
else if(GetPVarInt(playerid,"used") == 1)
{
SetCameraBehindPlayer(playerid);
DestroyPlayerObject(playerid,pObj[playerid]);
SetPVarInt(playerid,"used",0);
}